一直以来用的系统都是红旗公司的,今天装了一个RED HAT系统,但是在编译软件的时候出现了意想不到的事情.
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
然后用命令查看了一下:
[root@mail mail]# gcc
-bash: gcc: command not found
[root@mail mail]# cc
-bash: cc: command not found
发现就没有这二个命令,才知道RED HAT系统根本就没有编译器,由于我进行的默认形式的安装,所以考虑到如果不安装gcc或者cc编译器的话,配置什么服务都成问题,于是下载了gcc的一些软件去安装吧,又出现了一些依赖的问题,弄的心情真是糟透了。
下面是一些我的解决方法:
首先下载下列软件:glibc-kernheaders-2.4-9.1.87.i386.rpm
glibc-headers-2.3.2-95.20.i386.rpm
glibc-devel-2.3.2-95.20.i386.rpm
gcc-3.3.3-41.i586.rpm
cpp-3.3.3-41.i586.rpm
libstdc++-devel-3.3.3-41.i586.rpm
libstdc++-3.3.3-41.i586.rpm
gcc-c++-3.3.3-41.i586.rpm
然后开始安装:
[root@mail root]# rpm -qa|grep gcc
libgcc-3.2.3-20
[root@mail gcc]# rpm -ivh glibc-kernheaders-2.4-9.1.87.i386.rpm
warning: glibc-kernheaders-2.4-9.1.87.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%](1)
[root@mail gcc]# rpm -ivh glibc-headers-2.3.2-95.20.i386.rpm
warning: glibc-headers-2.3.2-95.20.i386.rpm: V3 DSA signature: NOKEY, key ID 73307de6
Preparing... ########################################### [100%]
1:glibc-headers ########################################### [100%]
[root@mail gcc]# rpm -ivh glibc-headers-2.3.2-95.20.i386.rpm
warning: glibc-headers-2.3.2-95.20.i386.rpm: V3 DSA signature: NOKEY, key ID 73307de6
Preparing... ########################################### [100%]
1:glibc-headers ########################################### [100%]
[root@mail gcc]# rpm -ivh cpp-3.3.3-41.i586.rpm
warning: cpp-3.3.3-41.i586.rpm: V3 DSA signature: NOKEY, key ID 9c800aca
Preparing... ########################################### [100%]
file /lib/cpp from install of cpp-3.3.3-41 conflicts with file from package cpp-3.2.3-20
file /usr/bin/cpp from install of cpp-3.3.3-41 conflicts with file from package cpp-3.2.3-20
file /usr/share/man/man1/cpp.1.gz from install of cpp-3.3.3-41 conflicts with file from package cpp-3.2.3-20
[root@mail gcc]# rpm -ivh gcc-3.3.3-41.i586.rpm
warning: gcc-3.3.3-41.i586.rpm: V3 DSA signature: NOKEY, key ID 9c800aca
error: Failed dependencies:
cpp = 3.3.3-41 is needed by gcc-3.3.3-41
在这里出现了一个依赖关系的错误,于是我就索性进行了下面的这个步骤.
[root@mail gcc]# rpm -Uvh cpp-3.3.3-41.i586.rpm
warning: cpp-3.3.3-41.i586.rpm: V3 DSA signature: NOKEY, key ID 9c800aca
Preparing... ########################################### [100%]
1:cpp ########################################### [100%]
然后在进行gcc-3.3.3-41.i586.rpm的安装,从这里看我的系统需要升级才行:)
[root@mail gcc]# rpm -ivh gcc-3.3.3-41.i586.rpm
warning: gcc-3.3.3-41.i586.rpm: V3 DSA signature: NOKEY, key ID 9c800aca
Preparing... ########################################### [100%]
1:gcc ########################################### [100%]
OK,下面进行检查测试:
[root@mail gcc]# rpm -qa|grep gcc
gcc-3.3.3-41
libgcc-3.2.3-20
[root@mail gcc]# gcc
gcc: no input files 到目前为止gcc编译器已经安装到系统当中,为了以后编译软件的时候再次出现错误,所以务必确保gcc-c++编译器也要安装上.
下面进行gcc-c++的安装.由于我的系统中在安装的过程中已经默认的安装了些软件,所以我进行的升级工作。如下:
[root@mail gcc]# rpm -Uvh libstdc++-3.3.3-41.i586.rpm
warning: libstdc++-3.3.3-41.i586.rpm: V3 DSA signature: NOKEY, key ID 9c800aca
Preparing... ########################################### [100%]
1:libstdc++ ########################################### [100%]
[root@mail gcc]# rpm -ivh libstdc++-devel-3.3.3-41.i586.rpm
warning: libstdc++-devel-3.3.3-41.i586.rpm: V3 DSA signature: NOKEY, key ID 9c800aca
Preparing... ########################################### [100%]
1:libstdc++-devel ########################################### [100%]
[root@mail gcc]# rpm -Uvh gcc-c++-3.3.3-41.i586.rpm
warning: gcc-c++-3.3.3-41.i586.rpm: V3 DSA signature: NOKEY, key ID 9c800aca
Preparing... ########################################### [100%]
1:gcc-c++ ########################################### [100%]
好了,到这里已经把gcc-c++编译工具也装进了系统。以后可以任意的进行源代码形式的编译工作了。。。
阅读(5334) | 评论(14) | 转发(0) |