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