Redhat安装包中包含兼容GCC,主要支持低版本GCC编译
1、查看包含的兼容gcc版本,主要查看下面几个版本
compat-gcc
compat-gcc-c++
compat-libstdc++
compat-libstdc++-devel
可以使用命令rpm -qpl *.rpm查看相应的包内容和安装后的路径
2、安装GCC
yum install compat-gcc-34
yum install compat-gcc-34-c++
yum install compat-libstdc++-33
3、查看安装后的gcc
/usr/bin/gcc34
/usr/bin/g++34
4、建立软链接
mv /usr/bin/gcc /usr/bin/gcc.bak
ln -s /usr/bin/gcc34 /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++.bak
ln -s /usr/bin/g++34 /usr/bin/g++