g++的命令
GNU
GNU编译器集合(GCC)是由GNU项目生产的优化编译器,支持各种编程语言、硬件架构和操作系统。自由软件基金会(FSF)根据GNU通用公共许可证(GNUGPL)将GCC作为自由软件分发。
GCC(特别是其中的C语言编译器)也常被认为是跨平台编译器的事实标准。
What is the difference between g++ and gcc?
gcc
andg++
are compiler-drivers of the GNU Compiler Collection (which was once upon a time just the GNU C Compiler).
gcc
: GNU C Compilerg++
: GNU C++ Compiler
The main differences:
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). gcc
compiling C files has fewer predefined macros.gcc
compiling*.cpp
andg++
compiling*.c\*.cpp
files has a few extra macros.
Extra Macros when compiling *.cpp
files:
1 |