ubuntu12.04 LTS Installation gcc 4.8

Source: Internet
Author: User

GCC 4.8.1 is the first fully supported C++11 compiler, Windows can be installed MinGW version of the SourceForge on the download, installation is more convenient. Installing on Linux requires installing some dependent libraries first. In Ubuntu12.04 LTS is installed by default gcc4.6.3, in fact, this version also supports some c++11 features, you can add "-std=c++0x" compilation option to use these features, but the support for multi-line libraries is poor, GCC 4.8.1 is installed through the PPA , so you need to install PPA repository. Here's a look at the installation steps:

Install dependencies First:

sudo apt-get install Libgmp-dev
sudo apt-get install libmpfr4 libmpfr-dev
sudo apt-get install Libmpc-dev libmpc2< Br>sudo apt-get install libtool
sudo apt-get install M4
sudo apt-get install Bison
sudo apt-get install flex
S Udo Apt-get Install autoconf

Next go to the main steps to install the 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 gcc/usr/bin/gcc-4.8 20 
sudo update-alternatives--install/usr/bin/g++ g++/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

After that, you can view the current GCC version by using the GCC-V command:

Network conditions are not good, the installation process is slow, you can use NetEase or Sohu source to improve the installation speed.

ubuntu12.04 LTS Installation gcc 4.8

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.