我收到此链接器错误,该错误不允许我进行编译。它只发生在模拟器上。
关键点:
- 仅发生在模拟器中
- 如同这个问题 https://stackoverflow.com/questions/1456185/build-error-missing-required-architecture-i386-in-file,但在我的 .pbxproj 文件中发现没有 FRAMEWORK_SEARCH_PATHS
- 虽然我的操作系统是 10.6.2,但我必须构建目标 1.5 以避免其他链接器错误
- libxml2.dylibIS必需且位于我的框架组中
- 其他引用的库我从未听说过。
- 尝试在框架下引入其他库,但没有解决。
Build SpaceTweet of project SpaceTweet with configuration Debug
Ld build/Debug-iphonesimulator/SpaceTweet.app/SpaceTweet normal i386
cd "/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)"
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk "-L/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/Debug-iphonesimulator" -L/Users/Scott/Desktop "-L/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/../../libYAJLIPhone-0" -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib -L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk/usr/lib -L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib "-F/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/Debug-iphonesimulator" -filelist "/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/SpaceTweet.build/Debug-iphonesimulator/SpaceTweet.build/Objects-normal/i386/SpaceTweet.LinkFileList" -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -framework AVFoundation -framework MessageUI -lYAJLIPhone -lxml2 -o "/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/Debug-iphonesimulator/SpaceTweet.app/SpaceTweet"
ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libxml2.dylib, missing required architecture i386 in file
ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libSystem.dylib, missing required architecture i386 in file
ld: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libobjc.A.dylib, missing required architecture i386 in file
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
CLUE:
同样,我的问题非常类似于这个问题已解决 https://stackoverflow.com/questions/1456185/build-error-missing-required-architecture-i386-in-file除了在我的情况下,我没有在项目包的 .pbxproj 文件中找到 FRAMEWORK_SEARCH_PATHS 条目,因此无法以解决该问题的方式解决。
问题是这样的:
-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib
这告诉您的模拟器 (i386) 构建使用设备 (arm) /usr/lib 中的文件。
在目标中找到 /usr/lib 所在的位置(只需使用目标的“获取信息/构建设置”选项卡中的“搜索气泡”)并将其删除。如果编译器没有被告知首先使用错误的 usr/lib,它将使用正确平台的 usr/lib。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)