LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1637|回复: 4

求助,设置环境变量CC到一个可用编译器问题。

[复制链接]
发表于 2006-5-5 10:28:24 | 显示全部楼层 |阅读模式
在一个安装教程中看到这么一句话,
“安装之前,系统中必须要有cc或者gcc等编译器,并且是可用的,或者用环境变量CC指定系统上的编译器。”
请问:如何用环境变量CC指定系统上的编译器。
也就是出现这个错误时,怎么解决:


./configure: line 2339: cc: conmand no fond
***The command 'cc -o conftest -g conftest.c' failed.
***You must set the environment variable CC to a working compiler.
发表于 2006-5-5 10:48:02 | 显示全部楼层
装上 GCC 它基本就能找到了。如果存在多个编译器,你想指定其中某一个。
假如你有
/usr/bin/gcc
/somewhere/bin/gcc
而想用后者编译,可以 export CC=/somewhere/bin/gcc ; ./configure 或者 CC="/somewhere/bin/gcc" ./configure 后者针对 Bash
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-5-6 10:45:43 | 显示全部楼层
我使用rpm包安装好了gcc,接着使用命令:
export CC=/usr/src/redhat/SOURCES/
然后到gtkspell-2.0.11文件夹下使用./configure命令如下:
[root@localhost gtkspell-2.0.11]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)...yes
checking for style of include used ye make...GNU
checking for gcc... /usr/src/redhat/SOURCES/
checking for C compiler default output file name ... configure:error:C complier cannot create executables

See 'config.log' for more details.

这个是什么错误?如何解决,谢谢:)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-5-6 10:46:27 | 显示全部楼层
我使用rpm包安装好了gcc,接着使用命令:
export CC=/usr/src/redhat/SOURCES/
然后到gtkspell-2.0.11文件夹下使用./configure命令如下:
[root@localhost gtkspell-2.0.11]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)...yes
checking for style of include used ye make...GNU
checking for gcc... /usr/src/redhat/SOURCES/
checking for C compiler default output file name ... configure:error:C complier cannot create executables

See 'config.log' for more details.

这个是什么错误?如何解决,谢谢:)
回复 支持 反对

使用道具 举报

发表于 2006-5-6 11:19:37 | 显示全部楼层
export CC=/usr/src/redhat/SOURCES/
CC 指的是编译器,你指到源码那里做什么。装了 GCC 一般就不用指定 CC 变量,他们都能找到。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表