标签:c99 install 输出 stat static runtime 交叉编译 .dll 链接库
采用mingw32可以在linux下直接编译c程序输出为windows下的exe程序或dll链接库。
个人编译的纯c程序(不含winapi),主要是c99程序,通常采用gcc/cc编译调试后,再用mingw输出win目标文件。
linux下目标程序及共享库与windows下的应用程序及链接库不同。
安装mingw
sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
即使不输入mingw32-binutils和mingw32-runtime也会自动安装
编译
i586-mingw32msvc-gcc hello.c -o hello.exe
个人习惯
alias cl=’i586-mingw32msvc-gcc -std=c99’
cl *.o -mdll -o test.dll
cl hello.c -o hello.exe
http://hustlei.tk/2014/08/ubuntu-compile-c-for-win.html
标签:c99 install 输出 stat static runtime 交叉编译 .dll 链接库
原文地址:http://www.cnblogs.com/findumars/p/6251008.html