不知何故,在为 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 代码生成块等),这看起来不正常。
问候