【问题标题】:No acceptable C compiler found in $PATH在 $PATH 中找不到可接受的 C 编译器
【发布时间】:2015-02-20 14:52:40
【问题描述】:

所以情况就是这样。我想通过将我的编程材料(Vim、Clang、Git、GCC)安装在一个可以在任何 Mac 上创建的文件夹中来设置一个可移植的编程环境。我在 /opt 中安装所有内容,默认情况下不存在,我应该具有创建的写入权限。我通过下载 Xcode 命令行工具和一个可以提取 PKG 内容的程序使 Vim、Clang 和 Git 工作。我将所有内容放在 /opt 中各自的文件夹中,例如 /opt/usr/bin。他们都在做花花公子。

这就是问题所在。我正试图让 GCC 工作。我下载了 OSX GCC 安装程序并使用 GCC-4.2 进行了相同的技术。问题是当我进行测试编译时,我运行它。 编辑:如果我执行 CC=gcc-4.2,我会收到相同的错误消息

./configure --prefix=/opt/usr/bin

并接收

checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
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... /usr/bin/sed
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for libatomic support... yes
checking for libcilkrts support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/opt/gcc-master':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

这很奇怪,因为 GCC-4.2 在我的 $PATH 中

echo $PATH
/opt/usr/bin:/opt/usr/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

cd /opt/usr/bin ; ls | grep gcc
gcc
gcc-4.2
i686-apple-darwin11-gcc-4.2.1

仅供参考:'gcc' 是一个不指向任何内容的符号链接。

which gcc-4.2
/opt/usr/bin/gcc-4.2

【问题讨论】:

  • 如果您解决了您的问题,本网站上的正确方法是发布答案并将其标记为已接受。
  • 好的。我现在就这样做。

标签: macos gcc


【解决方案1】:

我通过将其添加到我的 .zshrc 中解决了这个问题。它强制任何配置脚本查找 gcc-4.2 而不是 gcc。

CC=/opt/usr/bin/gcc-4.2

【讨论】:

    【解决方案2】:

    配置:错误:no acceptable C compiler found in $PATH 在执行 ./configure 命令之前,我使用了命令:

    sudo apt install gcc

    “不可接受的...”错误已解决。

    【讨论】:

      猜你喜欢
      • 2016-06-08
      • 1970-01-01
      • 2011-01-14
      • 2013-11-17
      • 1970-01-01
      • 2018-12-11
      • 2012-03-08
      • 2012-06-14
      • 1970-01-01
      相关资源
      最近更新 更多