GCC: GNU Compiler Collection
- Referrers to all the different languages that are supported by the GNU compiler.
gcc: GNU C Compiler Compiler
g++: GNU C++ Compiler
The main differences:
gccwill compile:*.c\*.cppfiles as C and C++ respectively.g++will compile:*.c\*.cppfiles 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 (gccdoes not do this). gcccompiling C files has fewer predefined macros.gcccompiling*.cppandg++compiling*.c\*.cppfiles has a few extra macros.
Extra Macros when compiling *.cpp files:
#define __GXX_WEAK__ 1
#define __cplusplus 1
#define __DEPRECATED 1
#define __GNUG__ 4
#define __EXCEPTIONS 1
#define __private_extern__ extern