What is the difference between g++ and gcc?
GCC: GNU Compiler Collection, Referrers to all the different languages that are supported by the GNU compiler.
gcc: GNU C Compiler
g++: 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 less predefined macros.
gcc compiling .cpp and g++ compiling *.c/.cpp files has a few extra macros.
Written by Ketan Parmar
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Gcc
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#