f78
However, C++ programs often require class libraries as well as a compiler that understands the C++ language—and under some circumstances, you might want to compile programs from standard input, or otherwise without a suffix that flags them as C++ programs. g++ is a program that calls GNU CC with the default language set to C++, and automatically specifies linking against the GNU class library libg++. On many systems, the script g++ is also installed with the name c++. Prior to release 2 of the compiler, there was a separate g++ compiler. That version was based on GNU CC, but not integrated with it. Versions of g++ with a 1.xx version number—for example, g++ version 1.37 or 1.42—are much less reliable than the versions integrated with GCC 2. Moreover, combining G++ 1.xx with a version 2 GCC will simply not work.
When you compile C++ programs, you may specify many of the same command-line options that you use for compiling programs in any language; or command-line options meaningful for C and related languages; or options that are meaningful only for C++ programs.
See Options controlling C dialect for explanations of options for languages related to C or explanations of options that are meaningful only for C++ programs. 0