【问题标题】:configure: error: C compiler cannot create executables with Mavericks配置:错误:C 编译器无法使用 Mavericks 创建可执行文件
【发布时间】:2013-12-03 14:46:51
【问题描述】:

我检查了stackoverflow,但还没有找到答案。

我正在尝试在 Mavericks 上安装 wget,如下所示。

这是我得到的:

bolo:wget-1.14 Michelin$ subl config.log 
bolo:wget-1.14 Michelin$ ./configure --with-ssl=openssl
configure: configuring for GNU Wget 1.14
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking build system type... i386-apple-darwin13.0.0
checking host system type... i386-apple-darwin13.0.0
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/Michelin/Downloads/wget-1.14':
configure: error: C compiler cannot create executables
See `config.log' for more details

我的配置日志:

https://gist.github.com/bolom/7552389

我已经安装了命令行工具,但我没有安装汇编器:(

B.

【问题讨论】:

  • 不幸的是,我没有 Mavericks,但从您的 config.log 看来,configure 找不到 as 汇编程序。它通常在 /usr/bin 中。确保它在那里。如果不是,请尝试查找(安装了 Mavericks 的人可能有更多信息)
  • 你说得对,我没有
  • 然而命令行工具在这里cl.ly/image/3m2U1N0q1B2l

标签: macos osx-mavericks


【解决方案1】:

下面在小牛队为我解决了这个问题。我必须使用 sudo 才能工作。

来自https://trac.macports.org/wiki/ProblemHotlist

Xcode 许可协议

当尝试构建用于编译 OS X 应用程序(例如 gimp-app)的端口时,编译可能会失败并出现 xcodebuild 错误。造成这种情况的一个可能原因是,在进行任何编译之前,可能需要从终端初始运行 xcodebuild 以接受 EULA。运行:

xcodebuild -许可证

从终端窗口并按照提示进行操作。接受 EULA 后,再次重建端口。

对于某些端口和某些版本的 Xcode(例如带有 Xcode 4.4+ 的 libunwind-headers),您可能需要以 root 身份接受许可,即:

sudo xcodebuild -license

这需要在任何 Xcode 升级后重复。

【讨论】:

    【解决方案2】:

    我建议使用自制软件 (http://brew.sh/) 来安装 wget:

    brew install wget
    

    给其他人的附加说明:为 Mavericks 升级命令行工具很容易,如下所示:http://www.computersnyou.com/2025/

    【讨论】:

      【解决方案3】:

      我第一次使用 Mac Ports 时遇到了同样的问题。

      当您新安装 Xcode 和命令行工具时,您必须先同意许可协议,然后这些工具(实际上是 Xcode)才能真正工作。

      打开一个终端会话并输入“ac”(不带引号)

      系统将提示您接受许可协议。向下翻页,最后输入“同意”。

      你也应该好好的!

      从那时起,编译就为我工作了。

      干杯

      【讨论】:

        猜你喜欢
        • 2013-09-24
        • 2012-05-08
        • 1970-01-01
        • 2021-04-23
        • 2019-02-03
        • 1970-01-01
        • 2020-01-21
        • 2018-08-02
        • 2014-04-12
        相关资源
        最近更新 更多