CentOS6.5 gcc 4.7.2 安装

CentOS6.5 gcc 4.7.2 安装

下载 gcc-4.7.2.tar.bz2 解压并进入,cd gcc-4.7.2

# ./contrib/download_prerequisites
# cd ..  
# mkdir build_gcc4.7.2 (安装路径)
# cd build_gcc4.7.2
# ../gcc-4.7.2/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
# make -j4
# sudo make install

启动路径更改

# sudo ln -s /安装路径/g++ /usr/bin/g++

配置环境变量

# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gcc4.7/build_gcc4.7/mpc:/usr/local/gcc4.7/build_gcc4.7/gmp:/usr/local/gcc4.7/build_gcc4.7/mpfr

你可能感兴趣的:(Unix/Linux,GCC)