checking whether the C compiler works... no configure: error: in `/home/farsight/farsight/feng/day8/jpeg-9e': configure: error: C compiler cannot create executables See `config.log' for more details
时间: 2024-01-27 17:04:46 浏览: 28
这个错误提示可能是由于您没有正确安装C编译器导致的。请确认您已经正确安装了C编译器,例如gcc。您可以使用以下命令来检查您的系统是否已经安装了gcc:
```
gcc --version
```
如果您的系统没有安装gcc,请根据您的操作系统选择正确的安装方法进行安装。如果您已经安装了gcc,但是仍然遇到了这个错误,请查看config.log文件,其中可能包含有关错误原因的更多详细信息。
相关问题
请扮演一位资深驱动工程师,解决以下问题:farsight@ubuntu:~/farsight/feng/day8/jpeg-9e$ ./configure --prefix=/usr/local/lib CC=arm-linux-gcc --host=arm-linux --enable-shared --enable-static configure: loading site script /opt/stm32_sdk/site-config-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi checking build system type... x86_64-pc-linux-gnu checking host system type... arm-unknown-linux-gnu checking target system type... arm-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-linux-strip... no checking for strip... strip checking for a race-free mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make supports nested variables... (cached) yes checking whether to enable maintainer-specific portions of Makefiles... no checking for arm-linux-gcc... arm-linux-gcc checking whether the C compiler works... no configure: error: in /home/farsight/farsight/feng/day8/jpeg-9e': configure: error: C compiler cannot create executables See config.log' for more details,请详细说明每一步解决步骤
首先,这个错误提示说 C 编译器无法创建可执行文件,可能是由于环境变量或编译器配置的问题导致的。
第一步,我们需要检查一下 arm-linux-gcc 是否已经正确安装并配置好环境变量。可以通过在终端中输入 arm-linux-gcc 命令来验证。
如果 arm-linux-gcc 没有安装或者环境变量没有配置好,我们需要先安装并配置好 arm-linux-gcc。
第二步,我们需要检查一下配置文件中的 CC 参数是否正确设置为 arm-linux-gcc。这个参数指定了使用的 C 编译器。
第三步,我们需要检查一下是否有 arm-linux-strip 工具。如果没有,我们需要安装 binutils 包,其中包含了 arm-linux-strip 工具。
第四步,我们需要检查一下是否有 gawk 工具。如果没有,我们需要安装 gawk 包。
第五步,我们需要检查一下是否有 strip 工具。如果没有,我们需要安装 binutils 包,其中包含了 strip 工具。
第六步,我们需要检查一下是否有可用的 mkdir -p 命令。如果没有,我们需要安装 coreutils 包,其中包含了 mkdir 命令。
最后,如果上述步骤都没有解决问题,我们需要查看 config.log 文件,里面可能有更详细的出错信息,帮助我们排查问题。
configure: error: in `/home/yx/gcc-7.3.0': configure: error: no acceptable C compiler found in $PATH
这个错误提示表明在执行configure命令时,系统找不到可接受的C编译器。解决方法是安装C编译器。你可以尝试执行以下命令安装build-essential软件包,该软件包包含了C编译器等必要的编译工具:
```
sudo apt-get install build-essential
```
如果安装后仍然出现相同的错误提示,你可以尝试手动指定C编译器的路径。例如,假设你已经安装了gcc-7.3.0,并且它的安装路径为/usr/local/gcc-7.3.0,你可以执行以下命令:
```
./configure --prefix=/usr/local/gcc-7.3.0 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp-6.2.0 --with-mpfr=/usr/local/mpfr-4.1.0 --with-mpc=/usr/local/mpc-1.1.0 CC=/usr/local/gcc-7.3.0/bin/gcc
```
其中CC=/usr/local/gcc-7.3.0/bin/gcc指定了C编译器的路径为/usr/local/gcc-7.3.0/bin/gcc。