【发布时间】: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的命令行工具也安装了,但我仍然面临这个问题