PDA

View Full Version : How to compile a windows program in Linux



camper365
May 11th, 2009, 09:36 PM
I am trying to write a program using Linux, and compile it into a Windows program.
How do I do that.
I know it's called cross-compiling, and I have looked a mingw, but I couldn't find anything there.

zolistir87
May 11th, 2009, 09:54 PM
I think you need a windows compiler for that.

The Cog
May 11th, 2009, 09:55 PM
http://ubuntuforums.org/showthread.php?t=1141290

To compile for Linux is:

gcc -Wall -o foo foo.c

To compile for windows is:

i586-mingw32msvc-gcc -Wall -o foo.exe foo.c

camper365
May 13th, 2009, 09:12 PM
thx