gcc已安装,编译其他软件时提示c编译器无法创建可执行文件

wdw98265 2013-07-21 09:47:33
操作系统是: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可用
...全文
1006 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Lydro 2013-11-10
  • 打赏
  • 举报
回复
有可能是你的gcc.exe是坏的,不能执行的。
积木 2013-07-22
  • 打赏
  • 举报
回复
引用 4 楼 wdw98265 的回复:
[quote=引用 3 楼 Idle_Cloud 的回复:] [quote=引用 2 楼 wdw98265 的回复:] [quote=引用 1 楼 Idle_Cloud 的回复:] 他说你编译器CC没找到./configure: error: C compiler cc is not found 你./configure --help下,把CC设置设置成gcc
如何设置? 我使用 ./configure --with-cc=/usr/bin(/usr,/usr/bin/gcc) 设置,一样无效 [root@localhost nginx-1.4.1]# ./configure --with-cc=/usr/bin checking for OS + Linux 2.6.32-358.el6.x86_64 x86_64 checking for C compiler ... not found ./configure: error: C compiler /usr/bin is not found [/quote]你可以吧./configure的结果贴出来看下,一般有个CC的选项,CC=gcc就好了 还有就是,一般机器上安装了gcc,都会有cc命令,你可以查查你的电脑有不有cc命令。[/quote] 有cc命令,/usr/bin下有cc文件和gcc文件 [root@localhost ~]# cc cc: no input files [root@localhost ~]# gcc gcc: no input files 另外./configure命令的全部结果就是1楼贴上去的那些,包括下面又尝试安装apache,编译的结果都在1楼[/quote] cc 是C 编译器吗 ? 这个cc链接到哪里去了? 一项一项的查下去。
wdw98265 2013-07-22
  • 打赏
  • 举报
回复
引用 3 楼 Idle_Cloud 的回复:
[quote=引用 2 楼 wdw98265 的回复:] [quote=引用 1 楼 Idle_Cloud 的回复:] 他说你编译器CC没找到./configure: error: C compiler cc is not found 你./configure --help下,把CC设置设置成gcc
如何设置? 我使用 ./configure --with-cc=/usr/bin(/usr,/usr/bin/gcc) 设置,一样无效 [root@localhost nginx-1.4.1]# ./configure --with-cc=/usr/bin checking for OS + Linux 2.6.32-358.el6.x86_64 x86_64 checking for C compiler ... not found ./configure: error: C compiler /usr/bin is not found [/quote]你可以吧./configure的结果贴出来看下,一般有个CC的选项,CC=gcc就好了 还有就是,一般机器上安装了gcc,都会有cc命令,你可以查查你的电脑有不有cc命令。[/quote] 有cc命令,/usr/bin下有cc文件和gcc文件 [root@localhost ~]# cc cc: no input files [root@localhost ~]# gcc gcc: no input files 另外./configure命令的全部结果就是1楼贴上去的那些,包括下面又尝试安装apache,编译的结果都在1楼
Carl_CCC 2013-07-21
  • 打赏
  • 举报
回复
引用 2 楼 wdw98265 的回复:
[quote=引用 1 楼 Idle_Cloud 的回复:] 他说你编译器CC没找到./configure: error: C compiler cc is not found 你./configure --help下,把CC设置设置成gcc
如何设置? 我使用 ./configure --with-cc=/usr/bin(/usr,/usr/bin/gcc) 设置,一样无效 [root@localhost nginx-1.4.1]# ./configure --with-cc=/usr/bin checking for OS + Linux 2.6.32-358.el6.x86_64 x86_64 checking for C compiler ... not found ./configure: error: C compiler /usr/bin is not found [/quote]你可以吧./configure的结果贴出来看下,一般有个CC的选项,CC=gcc就好了 还有就是,一般机器上安装了gcc,都会有cc命令,你可以查查你的电脑有不有cc命令。
wdw98265 2013-07-21
  • 打赏
  • 举报
回复
引用 1 楼 Idle_Cloud 的回复:
他说你编译器CC没找到./configure: error: C compiler cc is not found 你./configure --help下,把CC设置设置成gcc
如何设置? 我使用 ./configure --with-cc=/usr/bin(/usr,/usr/bin/gcc) 设置,一样无效 [root@localhost nginx-1.4.1]# ./configure --with-cc=/usr/bin checking for OS + Linux 2.6.32-358.el6.x86_64 x86_64 checking for C compiler ... not found ./configure: error: C compiler /usr/bin is not found
Carl_CCC 2013-07-21
  • 打赏
  • 举报
回复
他说你编译器CC没找到./configure: error: C compiler cc is not found 你./configure --help下,把CC设置设置成gcc

19,610

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧