【问题标题】:Can not execute gcc in Mac OS Lion无法在 Mac OS Lion 中执行 gcc
【发布时间】:2015-03-04 18:53:31
【问题描述】:

当使用 Xcode 出现“包不受信任”消息时,如何安装 gcc? 我用 brew install gcc 安装,它安装了 gcc,但我无法使用它:

brew install gcc
Warning: gcc-4.9.2_1 already installed
$ gcc-4.9.2 -o hello.o hello.c
-bash: gcc-4.9.2: command not found

$ gcc-4.9.2_1 -o hello.o hello.c
-bash: gcc-4.9.2_1: command not found
bidu:~ bidu$ whereis gcc
bidu:~ bidu$ whereis make

欢迎任何帮助。

【问题讨论】:

    标签: macos gcc osx-lion


    【解决方案1】:

    您需要安装命令行工具。

    >>> xcode-select --install
    

    http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/

    【讨论】:

    • 我错过了什么吗?这给了我一个带有帮助选项的输出,但不是一个要求安装命令行工具的弹出窗口。我正在和狮子一起工作
    【解决方案2】:

    好的,我找到了这个:

    https://developer.apple.com/downloads/index.action# 然后我将我的 mac 版本的命令行工具安装为 dmg。

    这行得通。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-07
      • 1970-01-01
      • 2012-03-07
      相关资源
      最近更新 更多