Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between gcc/g++ and cc1/cc1plus?

Tags:

gcc

g++

When I compile my projects and check the resources used by running top, the big CPU/memory hog is sometimes called g++ and sometimes cc1plus. What is the difference between the two, and should I ever call cc1plus directly?

like image 914
Michael Schlottke-Lakemper Avatar asked Nov 11 '13 05:11

Michael Schlottke-Lakemper


People also ask

What is cc1 and cc1plus?

cc1 is the internal command which takes preprocessed C-language files and converts them to assembly. It's the actual part that compiles C. For C++, there's cc1plus, and other internal commands for different languages.

What is cc1 GCC?

cc1 is also referred to as the compiler proper. cc1 preprocesses a c translation unit and compiles it into assembly code. The assembly code is converted into an object file with the assembler. Earlier versions of cc1 used /usr/bin/cpp for the preprocessing stage.

What's the difference between GCC and G ++?

Difference between gcc and g++ Both are the compilers in Linux to compile and run C and C++ programs. Initially gcc was the GNU C Compiler but now a day's GCC (GNU Compiler Collections) provides many compilers, two are: gcc and g++. gcc is used to compile C program while g++ is used to compile C++ program.

Does g ++ come with GCC?

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, .


1 Answers

What is the difference between the two,

The g++ is a compiler driver. It knows how to invoke the actual compiler (cc1plus), assembler and linker. It does not know how to parse or compile the sources.

and should I ever call cc1plus directly?

No.

like image 139
Employed Russian Avatar answered Oct 18 '22 10:10

Employed Russian