[引用〕Windows上的GNU開發平臺:MinGW

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.

發佈了24 篇原創文章 · 獲贊 6 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章