centos 6.10 安装 gcc 7.3

checking for suffix of object files... configure: error: in `/root/gcc-4.7.2/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/root/gcc-4.7.2'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/root/gcc-4.7.2'
make: *** [all] Error 2

 

安装必备:

1,gcc 4.7 低版本要保留

2,安装g++,yum install  gcc-c++

3,cd  /home/gcc-7.3.0

4,下载新版本gcc依赖文件 ./contrib/download_prerequisites

5,

cd /gcc-7.3.0
tar zxvf gmp-6.1.0.tar.gz
tar zxvf mpfr-3.1.4.tar.gz
tar zxvf mpc-1.0.3.tar.gz
ln -s  gmp-6.1.0 gmp
ln -s  mpfr-3.1.4 mpfr
ln -s  mpc-1.0.3 mpc
 

6,需要用到库

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/gcc-7.3.0/mpc-1.0.3/lib:/home/gcc-7.3.0/gmp-6.1.0/lib:/home/gcc-7.3.0/mpfr-3.1.4/lib

7,./configure --prefix=/usr --disable-multilib

8,make -j4 && make install

 

真实可用,参考文档

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值