CC and GCC in Linux
Zhou yinhui
In Linux, CC will be seen later, and GCC will be seen later, which is a bit messy. Are they the same thing? What is the difference?
In two parts:
First, if the scope of discussion is between UNIX and Linux, Then CC and GCC are not the same thing. CC from UNIXC LanguageCompiler, short for C compiler. GCC comes from the Linux world and is short for GNU Compiler Collection. Note that this is a set of compilers, not just C or C ++.
Secondly, if the scope of the discussion is limited to Linux, we can think that they are the same. When we call CC in Linux, it does not actually point to the Unix CC compiler, but to GCC, that is to say, CC is a link (shortcut) of GCC. Let's see the terminal output below:
Zhouyinhui @ Zhouyinhui - LAPTOP: / Etc / Alternatives $ Which CC
/ USR / Bin / CC
Zhouyinhui @ Zhouyinhui - LAPTOP: / Etc / Alternatives $ Ls - Al / USR / Bin / CC
Lrwxrwxrwx 1 Root 20 2010 - 01 - 20 23 : 56 / USR / Bin / CC -> / Etc / Alternatives / CC
Zhouyinhui @ Zhouyinhui - LAPTOP: / Etc / Alternatives $ Ls - Al / Etc / Alternatives / CC
Lrwxrwxrwx 1 Root 12 2010 - 01 - 20 23 : 56 / Etc / Alternatives / CC -> / USR / Bin / Gcc
The reason is as follows: for compatibility:
CC is charged for Unix. It can be used without the need of Linux. Therefore, there is no CC in Linux.
Then, the problem arises. If my C/C ++ project is written in UNIX, it will naturally use CC when writing the MAKEFILE file, when you put it in Linux, you cannot make it. You must change all the CC files to GCC. This is too troublesome, so Linux thought about such a convenient solution: without modifying makefile, continue to use cc. This CC is a "fake", which actually points to GCC.
-----------
For more information about G ++ and GCC, see here.