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

安装gcc时,提示no acceptable C compiler found in $PATH
在GCC网站上(http://gcc.gnu.org)下载了gcc-4.5.0
解压缩到/usr/local/src/gcc-4.5.0
安装gcc时,提示no acceptable C compiler found in $PATH

执行命令:
/usr/local/src/gcc-4.5.0/configure --prefix=/usr/local/gccobjdir
提示如下:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
我的root的PATH环境变量如下:
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
我在网上百度了一下说是没有安装gcc的组件
请问应该怎么做呢 
是不是系统中没有cc或者gcc等编译器或者环境变量CC没有指定系统上的编译器?
如果系统上没有编译器,就不能安装源代码形式的GCC啊
那应该怎么做呢?
我是要安装gcc啊 怎么获得c的编译器啊


------解决方案--------------------

好像 你一下发了3遍啊
不知道你使用的什么系统 比如ubuntu默认安装后是没有gcc的
需要sudo apt-get install build-essential 
 
------解决方案--------------------
checking for gcc... no
checking for cc... no
checking for cl.exe... no

从这个提示看是你的机子上本身没有gcc
但是你要编译新下的源码,就得用到gcc

有光盘的话,可以从光盘上下

没有的话,就从源中安装吧