【发布时间】:2009-09-30 13:50:44
【问题描述】:
在为 iPhone 编译时,我设法搞砸了我的 XCode 项目设置。 链接时失败了
ld: warning: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/AddressBook.framework/AddressBook, file is not of required architecture
... (same for the other frameworks).
所以问题是它在为 iPhone 编译时尝试使用模拟器框架。
当你查看实际的链接命令时:
setenv IPHONEOS_DEPLOYMENT_TARGET 3.1
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk
-L/Users/ben/development/xcode_output/Debug-iphoneos
-F/Users/ben/development/xcode_output/Debug-iphoneos
-F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/
System/Library/Frameworks
-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/
System/Library/Frameworks
可以看到模拟器框架和iPhone框架路径都提供了。 我该如何改变呢?我在设置的任何地方都没有找到它。
项目设置中的[FRAMEWORK_SEARCH_PATHS, -F]为空。
也许问题在于静态库中的链接。 该静态库的项目设置包含许多重复设置。 总是有两个相同的设置(例如,两个搜索路径块、两个 GCC-4.2 代码生成块等)看起来不正常。
问候
【问题讨论】:
-
您的“Base SDK”构建变量的值是多少? (右键单击目标和“获取信息”)。您还可以在 Build Info 中搜索有趣的字符串:iPhone、Simulator、3.0、3.1。您能否发布“重复设置”的屏幕截图?这个静态库是您项目中的另一个目标吗?
标签: iphone ios xcode xcodebuild