Linux默认安装没有GCC的,下次要注意了,把它安装上。

没有的话怎么安装?首先在Linux里挂载好Linux安装盘的ISO文件:
[root@localhost media]# mount /dev/cdrom /media/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only

按以下顺序进行安装:
[root@localhost media]# cd /media/cdrom/Server

[root@localhost Server]# rpm -ivh kernel-headers-2.6.18-164.el5.i386.rpm

[root@localhost Server]# rpm -ivh glibc-headers-2.5-42.i386.rpm

[root@localhost Server]# rpm -ivh glibc-devel-2.5-42.i386.rpm

[root@localhost Server]# rpm -ivh libgomp-4.4.0-6.el5.i386.rpm

[root@localhost Server]# rpm -ivh gcc-4.1.2-46.el5.i386.rpm

[root@localhost Server]# rpm -ivh libstdc++-devel-4.1.2-46.el5.i386.rpm

[root@localhost Server]# rpm -ivh gcc-c++-4.1.2-46.el5.i386.rpm
rpm -ivh gcc-c++-4.1.2-46.el5.i386.rpm

最后查看是否安装了GCC:
[root@localhost Server]# rpm -qa | grep gcc
gcc-4.1.2-46.el5
compat-libgcc-296-2.96-138
gcc-c++-4.1.2-46.el5
libgcc-4.1.2-46.el5