Martin Melka Martin Melka - 8 months ago 38
Linux Question

MinGW cross compiling on linux

I have a project which I want to compile for Windows. I have the appropriate makefile, everything works with g++. I ran

apt-get install mingw32
, downloaded a 100-ish MB package, but I cannot find out how to actually run it. There is no
executable nor can I find any help on the internet, so how do I actually compile with it?


If you see the ouput of dpkg -L mingw32 you can see that the package contains a toolchain i.e. a set of alternative tools (compiler, linker etc) useful to compile your code in another system.

You have to use /usr/bin/i586-mingw32msvc-g++ in order to compile your code. If I remember correctly exists a variable to tell the Makefile to use a toolchain like that.