Brief introduction
Using MINGW32 can be directly compiled under Linux C program output for Windows EXE program or DLL link library.
Personal compiled pure C program (without WINAPI), mainly C99 program, usually gcc/cc compiled debugging, and then use MinGW output win target file.
The target programs and shared libraries under Linux are different from the applications and link libraries under Windows.
Specific steps
Installing MinGW
sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
Automatic installation even if mingw32-binutils and Mingw32-runtime are not entered
Compile
I586-MINGW32MSVC-GCC Hello.c-o Hello.exe
Personal habits
Alias cl= ' I586-mingw32msvc-gcc-std=c99 '
CL *.o-mdll-o Test.dll
CL Hello.c-o hello.exe
MinGW command
- C COMPILER:I586-MINGW32MSVC-GCC
- C + + compiler:i586-mingw32msvc-g++
- Linker for Dynamic libs:i586-mingw32msvc-g++
- Linker for Static Libs:i586-mingw32msvc-ar
- Debugger:i586-mingw32msvc-gdb
Http://hustlei.tk/2014/08/ubuntu-compile-c-for-win.html
Ubuntu under cross compilation Windows C program