MINGW: Programs that compile Windows under a Linux system
Can be installed directly under Ubuntu:
sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
The post-installation compiler can:
i586-mingw32msvc-g++ (compiling C + + programs)
I586-MINGW32MSVC-GCC (compile C program)
Usage and gcc/g++ are very similar.
such as the HELLO.C program:
#include "Windows.h"
int WINAPI WinMain (hinstance hinstance,
HInstance hPrevInstance,
PSTR szCmdLine,
int icmdshow)
{
MessageBox (NULL, "Hello", "Hello Demo", MB_OK);
return (0);
}
Compile:
I586-MINGW32MSVC-GCC Hello.c-o Hello.exe-mwindows
Note:-mwindows indicates that it compiles a Windows program and does not require this parameter if the console (command line) program is compiled.
If you have wine installed, you can also test this program:
Wine Hello.exe
http://tieba.baidu.com/p/733815195
Http://www.cnblogs.com/lvdongjie/p/3763032.html
MinGW can be installed directly under Ubuntu (sudo apt-get install mingw32 mingw32-binutils mingw32-runtime, with examples, easy to use, pro-test success) Good