现在的位置: 首页 > 综合 > 正文

Windows上的GNU开发平台:MinGW

2013年11月02日 ⁄ 综合 ⁄ 共 1355字 ⁄ 字号 评论关闭

MinGW:即Minimalist GNU for Windows。它是一些头文件和函数库的集合,该集合允许人们在没有第三方动态链接库的情况下使用GCC(GNU Compiler C)产生Win32程序。

MinGW主要由GNU binary utilities、GCC和GDB组成。同时还包括一些必要的库,例如libc(C Runtime),及专门用于Win32环境的API接口库。如果你想学习linux环境下的编程,而又不想装linux,那你就装一个MinGW吧。

MSYS:Minimal GNU(POSIX)system on Windows,是一个小型的GNU环境,包括基本的bash,make等等。是Windows下最优秀的GNU环境。(是否厌倦了Cygwin蜗牛般的shell环境,试试MSYS中的rxvt吧)

MinGW & MSYS的主页:http://mingw.sourceforge.net/

配置MinGW环境
MinGW + MSYS + W32API

1、到http://sourceforge.net/projects/mingw/下载MinGW(我的版本是MinGW-3.1.0-1.exe)

     安装解压到 D:/MinGW目录

     在环境变量PATH中加入 D:/MinGW/bin

2、下载MSYS(我的版本是MSYS-1.0.10.exe)

     安装过程根据提示设置MinGW的路径。

3、下载Win32Api包(我的版本w32api-3.2-src.tar.gz)

    解压到D:/src/w32api-3.2目录;

    在msys环境下

   $ cd /d/src/w32api-3.2

   $ ./configure --prefix=/d/MinGW/

   $ make

   $ make install

 

注意:mingw的bin目录有一个mingw32-make.exe,msys的bin目录下也有一个make.exe。至于为什么会有mingw32-make.exe这个名字,MinGW的FAQ中说

Why is make named mingw32-make.exe?
The "native" (i.e.: MSVCRT dependent) port of make is lacking in some functionality and has modified functionality due to the lack of POSIX on Win32. There also exists a version of make in the MSYS distribution that is dependent on the MSYS runtime. This port operates more as make was intended to operate and gives less headaches during execution. Based on this, the MinGW developers/maintainers/packagers decided it would be best to rename the native version so that both the "native" version and the MSYS version could be present at the same time without file name collision.

 

抱歉!评论已关闭.