문제

I've read that mingw can be used on Linux to build a windows executable from C/C++.

Can other languages do this, and how about popular GUI libraries?

In particular I'm interested in OCaml and Haskell as languages and libSDL, wxWdgets, and GTK as libraries.

도움이 되었습니까?

해결책

It doesn't matter whether the language has support - what matters is the compiler (unless you're using a WORA language like Java). To answer your question, it is possible to build a cross compiler on Linux to target the Windows platform. SDL, wxWidgets, and GTK all have Windows versions to my knowledge, but you have to compile them with a compiler targeting Windows to be able to get object code that can run.

Cross compiling is very messy because you need to have one copy of a library of each architecture and platform that you want to target, and they all have to be installed in different places, so you need to play with linker flags a lot.

Here's a blog post explaining how to get a GCC distribution for Linux targeting Windows. And regarding Haskell and OCaml, sadly I'm not knowledgable in these areas, but the general case will hold true.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top