Install gcc4.8.1 on Ubuntu 12.04 & 13.04

Source: Internet
Author: User
Tags gcov

Finally, the complete implementation of C ++ 11 GCC 4.8.1.

Upgrade your system.

The following steps install gcc4.8.1 with content from: http://askubuntu.com/questions/312620/how-do-i-install-gcc-4-8-1-on-ubuntu-13-04

First install a software

apt-get install python-software-properties

Then

sudo add-apt-repository ppa:ubuntu-toolchain-r/testsudo apt-get updatesudo update-alternatives --remove-all gcc sudo update-alternatives --remove-all g++sudo apt-get install gcc-4.8sudo apt-get install g++-4.8sudo apt-get install gcc-4.8-multilibsudo apt-get install g++-4.8-multilibsudo apt-get install gcc-4.8-docsudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20sudo update-alternatives --config gccsudo update-alternatives --config g++sudo apt-get updatesudo apt-get upgrade -ysudo apt-get dist-upgrade

Check with GCC -- version, which is 4.8.1.

gcc --versiongcc (Ubuntu 4.8.1-2ubuntu1~13.04) 4.8.1Copyright (C) 2013 Free Software Foundation, Inc.This is free software; see the source for copying conditions.  There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If the/usr/bin/C ++ not found error occurs during compilation

Create two links to solve the problem:

ln -s /usr/bin/g++ /etc/alternatives/c++ln -s /etc/alternatives/c++ /usr/bin/c++

Similarly, when CC cannot be found, a link is also created:

ln -s /usr/bin/gcc /etc/alternatives/ccln -s /etc/alternatives/cc /usr/bin/cc

You can run the following command to find the installed files:

dpkg -L gcc-4.8/./usr/usr/bin/usr/bin/gcc-ranlib-4.8/usr/bin/gcov-4.8/usr/bin/gcc-ar-4.8/usr/bin/gcc-nm-4.8/usr/bin/gcc-4.8/usr/lib/usr/lib/gcc/usr/lib/gcc/x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/4.8/usr/lib/gcc/x86_64-linux-gnu/4.8/lto1/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper/usr/lib/gcc/x86_64-linux-gnu/4.8/collect2/usr/lib/gcc/x86_64-linux-gnu/4.8/libgomp.spec/usr/lib/gcc/x86_64-linux-gnu/4.8/libitm.spec/usr/share/usr/share/doc/usr/share/doc/gcc-4.8-base/usr/share/doc/gcc-4.8-base/README.ssp/usr/share/doc/gcc-4.8-base/gomp/usr/share/doc/gcc-4.8-base/gomp/changelog.gz/usr/share/doc/gcc-4.8-base/changelog.gz/usr/share/doc/gcc-4.8-base/gcc/usr/share/doc/gcc-4.8-base/gcc/changelog.gz/usr/share/doc/gcc-4.8-base/NEWS.html/usr/share/doc/gcc-4.8-base/README.Bugs/usr/share/doc/gcc-4.8-base/test-summary.gz/usr/share/doc/gcc-4.8-base/itm/usr/share/doc/gcc-4.8-base/itm/changelog.gz/usr/share/doc/gcc-4.8-base/quadmath/usr/share/doc/gcc-4.8-base/quadmath/changelog.gz/usr/share/doc/gcc-4.8-base/NEWS.gz/usr/share/man/usr/share/man/man1/usr/share/man/man1/gcov-4.8.1.gz/usr/share/man/man1/gcc-nm-4.8.1.gz/usr/share/man/man1/gcc-4.8.1.gz/usr/share/man/man1/gcc-ar-4.8.1.gz/usr/share/man/man1/gcc-ranlib-4.8.1.gz/usr/bin/x86_64-linux-gnu-gcc-ranlib-4.8/usr/bin/x86_64-linux-gnu-gcc-4.8/usr/bin/x86_64-linux-gnu-gcc-nm-4.8/usr/bin/x86_64-linux-gnu-gcc-ar-4.8/usr/share/doc/gcc-4.8/usr/share/man/man1/x86_64-linux-gnu-gcc-4.8.1.gz

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.