掃二維碼與項目經(jīng)理溝通
我們在微信上24小時期待你的聲音
解答本文疑問/技術咨詢/運營咨詢/技術建議/互聯(lián)網(wǎng)交流
一直都想在Eclipse下搭建一個C/C++的開發(fā)平臺,卻一直未能如愿。最近,終于成功了,其實很簡單。

安裝
設置環(huán)境變量
新建C項目
新建C++項目
來段HelloWorld
C的
C代碼
#include ﹤stdio.h>
#include ﹤stdlib.h>
int main(void) {
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
return EXIT_SUCCESS;
}
|
控制臺編譯輸出
Console代碼
**** Build of configuration Debug for project c **** **** Internal Builder is used for build **** gcc -O0 -g3 -Wall -c -fmessage-length=0 -osrc\c.o ..\src\c.c gcc -oc.exe src\c.o Build complete for project c Time consumed: 14011 ms. |
控制臺結果輸出
Console代碼
!!!Hello World!!! |
C++的
C++代碼
#include ﹤iostream>
using namespace std;
int main() {
cout ﹤﹤ "!!!Hello World!!!" ﹤﹤ endl; // prints !!!Hello World!!!
return 0;
}
|
控制臺編譯輸出
Console代碼
**** Build of configuration Debug for project cpp **** **** Internal Builder is used for build **** g++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\cpp.o ..\src\cpp.cpp g++ -ocpp.exe src\cpp.o Build complete for project cpp Time consumed: 25452 ms. |
控制臺結果輸出
Console代碼
!!!Hello World!!! |

我們在微信上24小時期待你的聲音
解答本文疑問/技術咨詢/運營咨詢/技術建議/互聯(lián)網(wǎng)交流