centos7系统更新gcc,根据https://blog.youkuaiyun.com/qq_33047753/article/details/102805075,所写更新,发现自己以前的步骤走不通了,这就让我很奇怪,出现下面的错误:
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for long long int... yes
checking for intmax_t... yes
checking for intptr_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for unsigned long long int... yes
checking for uintmax_t... yes
checking for uintptr_t... yes
checking for int64_t underlying type... long long
configure: error: error verifying int64_t uses long long
make[2]: *** [configure-stage1-gcc] Error 1
make[2]: Leaving directory `/home/sjarvis/dev/gcc/srcdir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/sjarvis/dev/gcc/srcdir'
make: *** [all] Error 2
找了一下博主有相同错误的解决方法,
https://blog.youkuaiyun.com/u012509728/article/details/49923995,该博主说是因为没有装g++ 导致,安装g++可解决
但是我发现我运行whereis g++ 是安装上了,而且使用yum install 也显示是最新的,没办法了,所以该方法不适合我的了,但是查了几个相似的问题,都说是g++没有安装上,我就运行 g++ -v,发现好像是没有装上,因为以前就是用yum install g++安装的,没有,考虑是否安装上,后来我就想要不就把安装的目录放入环境变量里吧,因为我把gcc的放进去了。
运行
vim ~/.bashrc
export PATH:/usr/bin/g++:$PATH
:x退出后,运行source ~/.bashrc 激活
然后运行 g++,又报错
bash: g++: Permission denied
所以给它权限,运行 chmod +x g++,再次运行g++,出现
g++: fatal error: no input files
compilation terminated.
哎·····,本人菜鸟就是菜鸟啊,在网上查了几个,我也没有查到什么结果,后来我看到该博主(https://www.zybuluo.com/comzyh/note/4709)发的,上面写的是,运行上面的结果就是安装上了,我滴天····,我搞了半天原来是安装好了,我还是不放心,又运行一下编译gcc,发现果然成功了,哎·····,这里就是给自己一个记录吧,也给大家借鉴一下,至于能不能解决大家发现的问题,我就不知道了,我是可以运行了。