CC and GCC in Linux

Source: Internet
Author: User

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.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.