1. Prepare a download directory in the home directory cd/home;mkdir download
2. Enter the/home/download directory and download gcc-4.8.2 wget http://gcc.skazkaforyou.com/releases/gcc-4.8.2/gcc-4.8.2.tar.gz.
3. Unzip the downloaded compressed package TAR-XZVF gcc-4.8.2.tar.gz;
4. Enter the library after the compressed directory CD gcc-4.8.2
5. Create a new compilation directory mkdir Gcc-build
6. Prepare the dependent Library,./contrib/download_prerequisites; it's better not to go into the contrib directory to execute download_prerequisites, or else make the error in the next step, indicating the missing relevant library
7../configure--preix=/usr/gcc482--enable-threads=posix--disable-checking--disable-multilib--enable-languages=c , C + + Note that if there is an error here, read 6 carefully and repeat the operation.
7. Make-j 4
8. Make Install
9. (recommended) Remove old version yum remove gcc
10. Establish a soft connection (here is 64 environment, 32 words similar) ln-s/USR/GCC482/BIN/GCC/USR/BIN/GCC
Ln-s/usr/gcc482/bin/g++/usr/bin/g++
Gcc-v found that it should be updated.
12. View Strings/usr/lib64/libstdc++.so.6|grep Glibcxx
Output
cp/usr/gcc482/lib64/libstdc++.so.6.0.18/usr/lib64/.
Rm-rf/usr/lib64/libstdc++.so.6.
Ln-sf/usr/lib64/libstdc++.so.6.0.18/usr/lib64/libstdc++.so.6.
16. View Strings/usr/lib64/libstdc++.so.6|grep Glibcxx
Output
17. Hold on to your practice.
CentOS Upgrade GCC Support c++11