[英]Why does configure say no C compiler found when GCC is installed?
我試圖在32位CentOS 6 VPS上從源代碼制作Sphinx 。
當我運行此命令時:
./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所以為什么不能配置找到一個可接受的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"
在Ubuntu Debian Base中安裝GCC
sudo apt-get install build-essential
我現在有同樣的問題。 我只是運行yum install gcc
配置時嘗試指定CC
:
CC=/usr/bin/gcc ./configure --prefix=/usr/local/sphinx
還要檢查編譯器是否生成可執行文件。 以下應該產生一個a.out
:
echo "int main(){0;}" | gcc -x c -
也許gcc不在你的道路上? 嘗試使用which gcc
找到gcc並將which gcc
添加到您的路徑中(如果它尚未存在)。
有時gcc創建了/usr/bin/gcc32
。 所以請創建一個ln -s /usr/bin/gcc32 /usr/bin/gcc
,然后編譯./configure
。
我心中也有同樣的問題。 我嘗試使用sudo apt-get install build-essential它仍然無法正常工作。 我只是在/ usr / bin /文件夾中創建了gcc-x二進制文件的硬鏈接。 sudo ls / usr / bin / gcc-x / usr / bin / gcc
這對我有用!
以下套餐也可以幫到你,
yum install gcc glibc glibc-common gd gd-devel -y
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.