Both the GCC compiler and the g++ compiler go through these three steps at compile time: 1, preprocessing generates. i files
2, after preprocessing conversion to assembly generation. s file
3, assembly conversion to machine code generation executable. o File
4. Connect to generate executable file
However, in the GCC compiler, is not directly connected to the C + + library, so in the link process will be an error, as long as the link command after the addition of a "-lstdc++" can be implemented.
Both GCC and g++ can compile C and C + + code, and. c Files g++ as C + + files, and. cpp files, both of which are recognized as C + + files, and the compile phase g++ calls GCC. However, GCC cannot be linked to a C + + program's library, so it calls g++ to link
Linux Run C + + program The difference between the GCC compiler and the g++ compiler