出现以上错误的时候,说明GCC 可能没有安装
- 在线安装
yum -y install gcc
- 离线安装
- 需准备以下安装包
mpfr-3.1.1-4.el7.x86_64.rpm
libmpc-1.0.1-3.el7.x86_64.rpm
kernel-headers-3.10.0-862.el7.x86_64.rpm
glibc-headers-2.17-222.el7.x86_64.rpm
glibc-devel-2.17-222.el7.x86_64.rpm
cpp-4.8.5-28.el7.x86_64.rpm
gcc-4.8.5-28.el7.x86_64.rpm
注:如需各种rpm包可以从这两个个地方获取:
http://mirrors.163.com/centos/6/os/x86_64/Packages/
http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/
- 将这些包上传到待安装的系统中,执行安装命令:
rpm -ivh *.rpm --nodeps --force
- 或按顺序安装
rpm -ivh mpfr-3.1.1-4.el7.x86_64.rpm
rpm -ivh libmpc-1.0.1-3.el7.x86_64.rpm
rpm -ivh kernel-headers-3.10.0-862.el7.x86_64.rpm
rpm -ivh glibc-headers-2.17-222.el7.x86_64.rpm
rpm -ivh glibc-devel-2.17-222.el7.x86_64.rpm
rpm -ivh cpp-4.8.5-28.el7.x86_64.rpm
rpm -ivh gcc-4.8.5-28.el7.x86_64.rpm
安装完成后查看安装版本
gcc -v
输出版本则安装成功