linux创建c文件编译错误,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

Thread model: posix

gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)

[root@localhost httpd-2.2.22]# which gcc

/usr/bin/gcc

去看了下,/usr/bin目录下有gcc这个文件

/usr/lib/gcc/x86_64-redhat-linux目录下有两个文件夹一个“4.4.4”一个“4.4.7”,内都有“include”文件夹和部分文件

请问如何设置使gcc可用

|

他说你编译器CC没找到./configure: error: C compiler cc is not found

你./configure --help下,把CC设置设置成gcc

|

cc 是C 编译器吗 ? 这个cc链接到哪里去了? 一项一项的查下去。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值