g++ is the front-end for gcc that builds C++ code. When you compile a .c file (C language source code), you invoke the gcc command, when you compile a .cpp file (C++ language source code), you invoke the g++ command.