CentOS 6.7 comes with the GCC version is 4.4.7, does not support C++11, manual upgrade, the current GCC version is the latest 5.2
1. Download the source package
wget http://mirrors.concertpass.com/gcc/releases/gcc-5.2.0/gcc-5.2.0.tar.bz2
2. Decompression
Tar jxvf gcc-5.2.0.tar.bz2
3. Automatic installation dependent
CD gcc-5.2.0
./contrib/download_prerequisites
4. Create a temporary directory to store intermediate files during compilation
mkdir gcc-build-5.2.0
CD gcc-build-5.2.0
.. /configure--enable-checking=release--enable-languages=c,c++--disable-multilib
5. Make
6. Sudo make install
7. View the new g++ version
[[Email protected]_test gcc-5.2.0]$ g++-V
Using built-in specs.
collect_gcc=g++
Collect_lto_wrapper=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/lto-wrapper
Target:x86_64-unknown-linux-gnu
Configured with:.. /configure--enable-checking=release--enable-languages=c,c++--disable-multilib
Thread Model:posix
GCC version 5.2.0 (GCC)
Note that the original gcc/g++ of the system in/usr/bin/g++/USR/BIN/GCC newly installed GCC in/USR/LOCAL/BIN/GCC
CentOS 6.7 Upgrade GCC to 5.2.0