(轉自網絡)Windows XP下MinGW的安裝與配置

http://sourceforge.net/projects/mingw/ 手動去下載最新的MinGW,或使用MinGW-5.1.4.exe,自動下載。但後者往往不能下載到最新的穩定包。
1、 手動下載說明,參見:
http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite
可從:http://sourceforge.net/projects/mingw/ 選擇包下載。
2、運行 MinGW-5.1.4.exe 的話,選擇 Candidate,一般會下載最新的包,選擇如下幾項:
MinGW base tools
g++ compiler
MingGW Make
默認路徑C:\MinGW,我裝在 E:\cplusplus\mingw
根據:http://wiki.codeblocks.org/index.php?title=MinGW_installation,需要下載如下必要的包:
* http://prdownloads.sf.net/mingw/gcc-core-3.4.5-20060117-1.tar.gz
* http://prdownloads.sf.net/mingw/gcc-g++-3.4.5-20060117-1.tar.gz
* http://prdownloads.sf.net/mingw/mingw-runtime-3.9.tar.gz
* http://prdownloads.sf.net/mingw/mingw-utils-0.3.tar.gz
* http://prdownloads.sf.net/mingw/w32api-3.6.tar.gz
* http://prdownloads.sf.net/mingw/binutils-2.17.50-20060824-1.tar.gz
* http://prdownloads.sf.net/mingw/mingw32-make-3.81-1.tar.gz
另外一個是調試器:
* http://prdownloads.sf.net/mingw/gdb-6.3-2.exe
安裝完後就配置環境變量吧。
控制面板--〉系統--〉系統詳細設置--〉環境變量
MINGW_PATH=E:\cplusplus\mingw
C_INCLUDE_PATH=%MINGW_PATH%\include;%MINGW_PATH%\lib\gcc\mingw32\3.4.5\include
CPLUS_INCLUDE_PATH=%MINGW_PATH%\include\c++\3.4.5;%MINGW_PATH%\include\c++\3.4.5\mingw32;%MINGW_PATH%\include\c++\3.4.5\backward;%C_INCLUDE_PATH%
LIBRARY_PATH=%MINGW_PATH%\lib;%MINGW_PATH%\lib\gcc\mingw32\3.4.5
PATH=%MINGW_PATH%\bin;%MINGW_PATH%\libexec\gcc\mingw32\3.4.5
注意:上面的很多3.4.5這個是gcc的版本號,要以真實的文件夾爲準。

現在開一個CMD吧.
直接到 E:\cplusplus\MinGW\bin 目錄下
輸入g++ --version 對應C++編譯版本
輸入gcc --version 對應C編譯版本
看到信息的話就OK了.
 
CMD的快捷方式可以右鍵"屬性",起始位置
直接設置到E:\cplusplus\MinGW\bin 目錄下吧
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章