日期:2014-05-16  浏览次数:20762 次

gcc已安装,编译其他软件时提示c编译器无法创建可执行文件
操作系统是:redhat 5以上版本,具体忘了
系统内核是:Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
安装nginx时,提示
[root@localhost nginx-1.4.1]# ./configure
checking for OS
 + Linux 2.6.32-358.el6.x86_64 x86_64
checking for C compiler ... not found

./configure: error: C compiler cc is not found

安装其他需要编译的程序时(譬如apache)提示c编译器无法使用
具体如下:
[root@localhost httpd-2.2.22]# ./configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

Configuring Apache Portable Runtime library ...

checking for APR... reconfig
configuring package in srclib/apr now
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring APR library
Platform: x86_64-unknown-linux-gnu
checking for working mkdir -p... yes
APR Version: 1.4.5
checking for chosen layout... apr
checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: in `/usr/local/bjta/httpd-2.2.22/srclib/apr':
configure: error: C compiler cannot create executables
See `config.log' for more details.

configure failed for srclib/apr

我检查gcc是否安装,已经安装:
[root@localhost httpd-2.2.22]# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux