为什么configure在安装GCC时说没有找到C编译器?

Gar*_*tet 25 linux terminal gcc sphinx yum

我试图在32位CentOS 6 VPS上从源代码制作Sphinx.

当我运行此命令时:

./configure --prefix=/usr/local/sphinx
Run Code Online (Sandbox Code Playgroud)

我收到此错误输出:

checking build environment
--------------------------

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no

checking for compiler programs
------------------------------

checking whether to compile debug version... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/gnotes/sphinx':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
Run Code Online (Sandbox Code Playgroud)

我不明白是安装了GCC所以为什么不能配置找到一个可接受的C编译器?

这是yum的输出:

sudo yum install gcc

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.metrocast.net
 * extras: centos.mirror.constant.com
 * updates: mirror.lug.udel.edu
base                                                                                                                                                                      | 3.7 kB     00:00     
extras                                                                                                                                                                    | 3.5 kB     00:00     
updates                                                                                                                                                                   | 3.4 kB     00:00     
Setting up Install Process
Package gcc-4.4.7-3.el6.i686 already installed and latest version
Nothing to do
Run Code Online (Sandbox Code Playgroud)

是什么赋予了?

kds*_*kds 35

尝试 yum groupinstall "Development Tools"

如果安装成功,那么您将拥有一整套开发工具.如gcc,g ++,make,ld等.之后,您可以再次尝试编译代码块.

由于yum不推荐使用,您可以使用dnf:

dnf groupinstall "Development Tools"
Run Code Online (Sandbox Code Playgroud)


lak*_*dan 12

Ubuntu Debian Base中安装GCC

sudo apt-get install build-essential
Run Code Online (Sandbox Code Playgroud)


Cha*_*iam 7

我现在有同样的问题.我跑了yum install gcc

  • 是的,您可能不一定需要开发工具附带的所有内容 (3认同)

dev*_*ull 5

CC配置时尝试指定:

CC=/usr/bin/gcc ./configure --prefix=/usr/local/sphinx
Run Code Online (Sandbox Code Playgroud)

还要检查编译器是否生成可执行文件.以下应该产生一个a.out:

echo "int main(){0;}" | gcc -x c -
Run Code Online (Sandbox Code Playgroud)