Har*_*ngh 5 compiler-construction bash xcode xcode5
我试图在目标C代码上实现某种预编译效果(在此说明)。按照这些有用的说明,我设法在Xcode 5中安装了一个自定义编译器。但是,我通过尝试叮当导致错误:
我的自定义编译器的可执行文件:
#!/bin/bash
clang "$@"
Run Code Online (Sandbox Code Playgroud)
错误信息:
While building module 'UIKit' imported from /Users/Club15CC/Google Drive/Code/Frogger/Frogger/Frogger-Prefix.pch:14:
...
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h:33:1:
error: use of empty enum
};
^
/Users/Club15CC/Google Drive/Code/Frogger/Frogger/Frogger-Prefix.pch:14:13: fatal error: could not build module 'UIKit'
#import <UIKit/UIKit.h>
~~~~~~~^
2 errors generated.
Command /usr/bin/frogger failed with exit code 1
Run Code Online (Sandbox Code Playgroud)
请注意,可执行文件被称为frogger测试Xcode项目Frogger。
使用默认编译器可以很好地构建。枚举错误是否暗示未通过某些标志?bash的大小是否有限制$@?编译器调用字符串很长,也许正在被截断?
谢谢你的帮助...
----更新----
好像是将错误的“最低版本”标志传递给自定义编译器:普通的LLVM编译器具有此标志:-mios-simulator-version-min=7.0而我的自定义程序正在获得此标志:-mmacosx-version-min=10.6-这是导致UIDevice错误的原因。正确的标志是在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications/Native Build System.xcspeciOS 内部处理的,等效标志是在iOS 内部处理的,与模拟器相反。似乎我的自定义编译器没有采用这些规范。我在这里头晕!