Update gcc version to GCC 6.1.0 under CentOS

Source: Internet
Author: User

recently, the GCC version of Linux has been updated to GCC 6.1.0 version, I checked the GCC version on my machine ....


-------------gcc 4.4.7 I go, this is too low, and we know that GCC 4.4.7 is not support c++11, my temper is more irritable, decisive to upgrade to GCC 6.1.0 version!

I started with the Yum Update gcc command, and the hateful thing was that the machine also put GCC 4.4. Version 7 back to me again, you said hateful and hated, so I found the resources of GCC, as follows:


URL: http://ftp.gnu.org/gnu/gcc/



I opened the gcc-6.1.0. The results are as follows:

The methods we download on the Linux machine are:

Http://wget http://ftp.gnu.org/gnu/gcc/gcc-6.1.0/gcc-6.1.0.tar.bz2

Then unzip, then install

In fact, the method is this:


haha, not installed children's shoes do not hurry up, to install support c++11 version of the GCC

TAR-JXVF GCC-6.1.0.TAR.BZ2CD gcc-6.1.0./contrib/download_prerequisitesmkdir BUILDCD Build: /configure-enable-checking=release-enable-languages=c,c++-disable-multilibmakemake Install

The approximate steps are as follows:

1. First unzip, then enter the file

2. Implementation . /contrib/download_prerequisites , do not ask why, in fact, it is to download some libraries to rely on, and to do the configuration work

3. Create a file to hold the compiled file into the file

4. Implementation  .. /configure-enable-checking=release-enable-languages=c,c++-disable-multilib

5.make (MAKE-J4, this is multi-core system use, I use a virtual machine, so use make option)

6. The above process we all know is very long, this time better sleep first or write a few algorithm questions, and then come back to see

7. When the above steps are complete, see if there are any errors, Make Install

8. Last g++--version check version

Now that the installation is complete, we can use it to enjoy the joy of programming.

Update gcc version to GCC 6.1.0 under CentOS

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.