Home  >  Q&A  >  body text

linux - What is the difference between gcc and gcc-c++

I don’t know the difference between yum install gcc and yum install gcc-c++ when installing the compiler.
Is there any difference

天蓬老师天蓬老师2713 days ago605

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-05-16 13:26:14

    Reference

    This package adds C++ support to the GNU Compiler Collection.
    It includes support for most of the current C++ specification,
    including templates and exception handling。

    It can be seen that gcc-c++ provides c++ language feature support for gcc

    Actually, in terms of concept, gcc refers to the entire set of gcc tools, which is divided into gcc front-end and gcc back-end (I personally understand it as gcc shell and gcc engine). The gcc front-end corresponds to various specific languages ​​(such as c++ /go, etc.) processing (corresponding syntax checks for specific languages ​​such as c++/go, converting codes in c++/go and other languages ​​into c codes, etc.), the gcc backend correspondingly converts the front-end c code to your computer Hardware-related assembly or machine code, etc. (The description may not be particularly accurate, but that’s the general meaning)

    As far as software packages are concerned, gcc.rpm就是那个gcc后端,而gcc-c++.rpmis the gcc front-end for the specific language of c++. This design ensures full flexibility. For different programming languages, you only need to develop different gcc front ends; at the same time, for users, if I only need to support compiling C++, then I will only install one C++ Just use the gcc front-end, and it will not contain program codes with other language features, making the user's software environment relatively lightweight and clean

    reply
    0
  • Cancelreply