C++11 features GCC source package

Source: Internet
Author: User

1. Download the latest GCC source package 2.解压缩 tar -xf gcc-4.9.1.tar.gz

3.cd gcc-4.9.1

4. Run the Download_prerequisites script, ./contrib/download_prerequisites This script will automatically help you to download the required dependent files and libraries

5. Create the output directory and place all the intermediate files in the directory.

cd gcc_temp

6. Run   7. make & make install

============================================================================================

This article mainly introduces how to upgrade GCC to support c++11 under Linux system . GCC is currently the most supported compiler for C++11, but requires GCC4.8 and above.

This article uses the operating system: Centos 6.4 desktop,64bit;

Original GCC version: 4.4.7;

Objective: To upgrade GCC to 4.8.2 to support c++11.

  1. Get gcc 4.8.2 package: wget http://gcc.skazkaforyou.com/releases/gcc-4.8.2/gcc-4.8.2.tar.gz;

  2. Decompression: TAR-XF gcc-4.8.2.tar.gz;

  3. Go to directory gcc-4.8.2, run:./contrib/download_prerequisites. This magical script file will help us to download, configure and install dependent libraries, which can save us a lot of time and effort.

  4. Set up the output directory and go to the directory: mkdir GCC-BUILD-4.8.2;CD gcc-build-4.8.2;

  5. .. /configure–enable-checking=release–enable-languages=c,c++–disable-multilib. –enable-languages says you want your GCC to support those languages, –disable-multilib does not generate a cross-compiler that compiles executable code to other platforms. The compiler generated by –disable-checking does not perform additional checks during compilation, or it can use –enable-checking=xxx to add some checks;

  6. Compile: Make; note this step and the previous step, more time-consuming;

  7. Installation: make install;

  8. Verification: gcc-v, or g++-V, if the GCC version shown is still the previous version, you will need to restart the system, or you can view the installation location of GCC: which GCC, and then in view version/usr/local/bin/gcc-v, usually GCC is installed at that location, if displayed as;

C++11 features GCC source package

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.