我正试图在32位CentOS 6 VPS上从源代码制作狮身人面像 。
当我运行这个命令时:
./configure --prefix=/usr/local/sphinx
我得到这个错误输出:
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.
我不明白的是,GCC是安装的,为什么不能configurationfind一个可以接受的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
是什么赋予了?
尝试yum groupinstall "Development Tools"
如果安装成功,那么您将拥有一套完整的开发工具。 如gcc,g ++,make,ld等。 之后,您可以再次尝试编译代码块。
由于yum
已被弃用,您可以使用dnf
来代替:
dnf groupinstall "Development Tools"
我现在有同样的问题。 我只是运行yum install gcc
在Ubuntu Debian Base中安装GCC
sudo apt-get install build-essential
尝试在配置时指定CC
:
CC=/usr/bin/gcc ./configure --prefix=/usr/local/sphinx
还要检查你的编译器是否生成可执行文件 以下应该产生一个a.out
:
echo "int main(){0;}" | gcc -xc -
也许gcc不在你的路上? 尝试使用which gcc
找到gcc,并将其添加到您的路径,如果它不在那里。
有时gcc已经创建为/usr/bin/gcc32
。 所以请创建一个ln -s /usr/bin/gcc32 /usr/bin/gcc
然后编译./configure
。
这个包也帮你了,
yum install gcc glibc glibc-common gd gd-devel -y
我头脑里也有同样的问题。 我尝试使用sudo apt-get install build-essential它仍然无法正常工作。 我只是在/ usr / bin /文件夹中创建了一个硬链接到gcc-x二进制文件。 sudo ls / usr / bin / gcc-x / usr / bin / gcc
这对我有效!