Install GCC 12.04 on Ubuntu 4.8 LTS

Source: Internet
Author: User

Gcc 4.8.1 is the first compiler that fully supports C ++ 11. mingw can be installed on Windows and downloaded from sourceforge for ease of installation. To install it on Linux, you must first install some dependent libraries. Gcc4.6.3 is installed in Ubuntu 12.04 lts by default. In fact, this version also supports some c ++ 11 features, you can use these features by adding the "-std = c ++ 0x" Compilation option, but the multi-threaded library is poorly supported. gcc 4.8.1 is installed through ppa, therefore, you need to install ppa repository. The installation steps are as follows:
 
First install the dependency:
 
Sudo apt-get install libgmp-dev
Sudo apt-get install libmp Fr4 libmp fr-dev
Sudo apt-get install libmp C-dev libmpc2
Sudo apt-get install libtool
Sudo apt-get install m4
Sudo apt-get install bison
Sudo apt-get install flex
Sudo apt-get install autoconf
 
Next, go to the main steps to install gcc4.8.1:
 
Sudo add-apt-repository ppa: ubuntu-toolchain-r/test
Sudo apt-get update

Sudo apt-get install gcc-4.8
Sudo apt-get install g ++-4.8
Sudo apt-get install gcc-4.8-multilib
Sudo apt-get install g ++-4.8-multilib
Sudo apt-get install gcc-4.8-doc
Sudo update-alternatives -- install/usr/bin/gcc/usr/bin/gcc-4.8 20
Sudo update-alternatives -- install/usr/bin/g ++-4.8 20
Sudo update-alternatives -- config gcc
Sudo update-alternatives -- config g ++

Sudo apt-get update
Sudo apt-get upgrade-y
Sudo apt-get dist-upgrade
 
Then you can use it. You can use the gcc-v command to view the current gcc version:


 
 
If the network conditions are poor, the installation process is slow. You can use the source of Netease or sohu to increase the installation speed.

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.