【问题标题】:failed to exec /Applications/Xcode.app/Contents/Developer/usr/bin/clang: No such file or directory无法执行 /Applications/Xcode.app/Contents/Developer/usr/bin/clang:没有这样的文件或目录
【发布时间】:2014-01-07 19:05:09
【问题描述】:

Xcode 5 破坏了我的编译脚本。我怀疑是因为 clang 现在直接位于 /usr/bin 而不是它通常的位置。但是,我不确定如何将其告诉 gcc。任何提示将不胜感激。我正在为 iOS 编译。

   CPPFLAGS= -arch i686 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -fno-short-wchar -fno-short-enums -miphoneos-version-min=4.2.1
    CXXFLAGS= -arch i686 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -fno-short-wchar -fno-short-enums -miphoneos-version-min=4.2.1
    CFLAGS=
    gcc -Iinclude  -arch i686 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -fno-short-wchar -fno-short-enums -miphoneos-version-min=4.2.1   -c -o src_c/stem_UTF_8_danish.o src_c/stem_UTF_8_danish.c
    gcc: failed to exec /Applications/Xcode.app/Contents/Developer/usr/bin/clang: No such file or directory
    make: *** [src_c/stem_UTF_8_danish.o] Error 71

更新。我能够通过不带参数直接从 iPhoneSimulator usr/bin 调用 gcc 来重复该问题。

tim$ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform//Developer/us                                    r/bin/gcc
gcc: failed to exec /Applications/Xcode.app/Contents/Developer/usr/bin/clang: No such file or directory

我能够通过使用 /usr/bin 中的 clang 和适当的 sysroot 来编译它。但这是等价的吗?

【问题讨论】:

  • 确实没有足够的信息来调试这个问题。 /usr/bin 包装器只需调用 xcode-select 指定的默认应用程序 - 是 /Applications/Xcode.app/Contents/Developer/usr/bin 下的 clang 二进制文件吗??
  • 您的编译受到干扰。 xcrun -find clang 报告什么?它应该显示类似:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
  • 你是怎么解决的?我遇到了同样的问题,Xcode的命令行工具也安装了,但我仍然面临这个问题

标签: c++ ios xcode clang


【解决方案1】:

我在升级到 Xcode 5.1 时注意到同样的问题当我运行“xcrun -find clang”时,它说“您尚未同意 XCode 许可协议。您必须同意以下两个 Xcode 许可协议才能使用Xcode。”它吐出了协议,给了我一个同意的机会,我做到了。这解决了问题。去图吧。

干杯 - 埃德

【讨论】:

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