aircraft aircraft -4 years ago 114
Linux Question

What's the different about gcc and gcc++?

I follow my tutorial in linux to install some package:

yum install -y pcre pcre-devel openssl openssl-devel gcc gcc++

I am not sure about the gcc means
GPN Compiler Collection
GPN C Compiler
, I just not sure, because if it means the latter, the
maybe means
GNU Compiler C++

Who is there to answer my doubts?

Answer Source

From the "Programming Languages Supported by GCC" page:

The abbreviation GCC has multiple meanings in common use. The current official meaning is “GNU Compiler Collection”, which refers generically to the complete suite of tools. The name historically stood for “GNU C Compiler”, and this usage is still common when the emphasis is on compiling C programs. Finally, the name is also used when speaking of the language-independent component of GCC: code shared among the compilers for all supported languages.

And regarding the difference between the gcc and g++ commands, see the "GCC Command Options" page:

The usual way to run GCC is to run the executable called gcc, or machine-gcc when cross-compiling, or machine-gcc-version to run a specific version of GCC. When you compile C++ programs, you should invoke GCC as g++ instead. See Compiling C++ Programs, for information about the differences in behavior between gcc and g++ when compiling C++ programs.

and from "Compiling C++ Programs"

the use of gcc does not add the C++ library. g++ is a program that calls GCC and automatically specifies linking against the C++ library. It treats ‘.c’, ‘.h’ and ‘.i’ files as C++ source files instead of C source files unless -x is used.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download