Upgrade to 4.8 "This should be the latest, but the online search has reached 5.2, feeling behind a bit more stable, of course, there is this version is the new one of the most used"
wget Http://people.centos.org/tru/devtools-2/devtools-2.repo-O/etc/yum.repos.d/devtools-2.repo
Or
Cd/etc/yum.repos.dwget Http://people.centos.org/tru/devtools-2/devtools-2.repo
And then
Yum Install DEVTOOLSET-2-GCC devtoolset-2-binutils devtoolset-2-gcc-c++
This will install the files on the
/opt/rh/devtoolset-2
If you want the editor to handle it, this action
Export CC=/OPT/RH/DEVTOOLSET-2/ROOT/USR/BIN/GCC Export Cpp=/opt/rh/devtoolset-2/root/usr/bin/cppexport CXX=/OPT/RH /devtoolset-2/root/usr/bin/c++
If you want GCC to replace the local, of course, it is not really to replace, just put him under our/usrlocal/bin, do not have to control the system comes with the "/usr/bin".
Ln-s/opt/rh/devtoolset-2/root/usr/bin/*/USR/LOCAL/BIN/HASH-RGCC--version
This two-part path has changed, "See Here": Http://people.centos.org/tru/devtools-2/readme
Reference: Http://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos
CentOS upgrade support to C++11, gcc4.8.2