2013-09-30 124 views
3

我的項目是C和C++共享庫(我在Linux平臺上使用Eclipse IDE)。項目採用C編譯器(GCC)的默認設置。任何人都可以爲我的項目建議如何將編譯器從C更改爲C++。如何在Eclipse IDE中將編譯器從C更改爲C++?

+0

什麼是你的源文件的擴展名? '* .c'或'* .cpp' – Sadique

+0

我假設用cpp或cc或cxx等「C++擴展」來保存文件會產生預期的效果,但是這不是您要查找的內容? – rubenvb

回答

2
0

GCC:GNU編譯器集合

GCC:GNU C編譯器G ++:GNU C++編譯器

的主要區別:

gcc will compile: .c/.cpp files as C and C++ respectively. 

g++ will compile: .c/.cpp files but they will all be treated as C++ files. 

Also if you use g++ to link the object files it automatically links in the std C++ libraries (gcc does not do this).