如何将编译器从C更改为C++;在EclipseIDE中? 我的项目是C++中的C和共享库(我在Linux平台上使用Eclipse IDE)。采用C编译器(GCC)的项目的默认设置。有人能告诉我如何将编译器从C转换为C++吗?P> > PGC > GCC可以编译C和C++源文件。它使用文件名扩展来确定它是否应该编译为C或C++。

如何将编译器从C更改为C++;在EclipseIDE中? 我的项目是C++中的C和共享库(我在Linux平台上使用Eclipse IDE)。采用C编译器(GCC)的项目的默认设置。有人能告诉我如何将编译器从C转换为C++吗?P> > PGC > GCC可以编译C和C++源文件。它使用文件名扩展来确定它是否应该编译为C或C++。,c,eclipse,C,Eclipse,GCC:GNU编译器集合 GC:GNUC编译器G++:GNU C++编译器< /P> 主要区别是: 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 l

GCC:GNU编译器集合

GC:GNUC编译器G++:GNU C++编译器< /P> 主要区别是:

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).

源文件的扩展名是什么
*.c
*.cpp
我认为使用“c++扩展名”保存文件(如cpp、cc或cxx)会达到预期效果,但这不是您想要的吗?