配置 Eclipse 編譯C/C++代碼

來源:互聯網
上載者:User

介紹兩種方式使用eclipse編譯C/C++代碼

一、minGW + eclipse classic + CDT

(1) 下載安裝 minGW
地址:http://sourceforge.net/project/showfiles.php?group_id=2435
安裝到一級目錄下,如 D:\minGW。
安裝完畢,配置環境變數如下:
MinGW = D:\minGW
PATH = %MinGW%\bin; %PATH%
C_INCLUDE_PATH = %MinGW%\include
CPLUS_INCLUDE_PATH = %MinGW%\lib\gcc\mingw32\4.6.2\include\c++;%C_INCLUDE_PATH% 
LIBRARY_PATH = %MinGW%\lib

(2) 安裝Eclipse Classic 4.2和相關外掛程式CDT

http://www.eclipse.org/downloads/
下載 Eclipse Classic 4.2
進入主介面,help -> install new softwares,
在 WorkWith 下選擇:Juno -

http://download.eclipse.org/releases/juno,

可以安裝很多外掛程式,例如 Programming Languages -> C/C++,CDT等。

建議使用此種方式。

二、minGW + eclipse c/c++ 版本
eclipse for C/C++版本內建了CDT外掛程式,直接下載 eclipse for C/C++版本。
Eclipse IDE for C/C++ Developers

http://www.eclipse.org/downloads/


使用:
File,new,C++ project, Makefile project,右側 Other Toolchain 選擇MinGW GCC。

編譯:

在產生的makefile檔案上右鍵,選擇 make targets, Build,單機Add按鈕,在彈出的視窗中輸入 target name,例如hello。

添加成功後,雙擊添加的target即可編譯。

使用請參考:http://wenku.baidu.com/view/701977bf1a37f111f1855b7e.html

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.