What are the difference between the 3 compilers CC, gcc, g++ when compiling C and C++ code in terms of assembly code generation, available libraries, language features, etc
CC
is an environment variable referring to the system's C compiler. What it points to (libraries accessible, etc) depend on platform. Often it will point to /usr/bin/cc
, the actual c complier (driver). On linux platforms, CC
almost always points to /usr/bin/gcc
.
gcc
is the driver binary for the GNU compiler collection. It can compile C, C++, and possibly other languages; it determines the language by the file extension.
g++
is a driver binary like gcc
, but with a few special options set for compiling C++. Notably (in my experience), g++
will link libstdc++ by default, while gcc
won't.