From: http://www.cppfans.org/1719.html
Because the main platform for the work of Linux, and Linux because there is no newer than the new GCC, only 4.7, and we use the c++11, have to upgrade their own, upgrade method is relatively simple, is time consuming.
1. Download the latest GCC source packagewget http://gcc.skazkaforyou.com/releases/gcc-4.9.1/gcc-4.9.1.tar.gz (注:中国可以下载这个USTC上的http://mirrors.ustc.edu.cn/gnu/gcc/gcc-4.9.1/)
2. Unziptar -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.
mkdir gcc_temp
CD Gcc_temp
6. Running../configure –enable-checking=release –enable-languages=c,c++ –disable-multilib
7.make & make install
Related reference: http://www.21ops.com/linux/14922.html
"Reprint" How to upgrade GCC on Linux to the latest version