1. 下载gcc-4.8 源码包wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.8.2/gcc-4.8.2.tar.gz
2. 解压源码包tar -zxvf gcc-4.8.2.tar.gz
3. 下载依赖库。cd /home/gcc-4.8.2/
./contrib/download_prerequisites
mkdir gcc-bulid-4.8.2
cd gcc-bulid-4.8.2
4.执行configure命令,产生makefile../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
5. 编译、安装。make && make install
6.查看gcc版本:gcc -v
7 .编译时的错误处理。
错误一:configure: error: C++ compiler missing or inoperational
make[2]: \*** [configure-stage1-libcpp] Error 1
make[2]: Leaving directory `/home/liukk/gcc-4.8.1'
make[1]: \*** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/liukk/gcc-4.8.1'
make: \*** [a