Ios 苹果Mach-O连接器错误

Ios 苹果Mach-O连接器错误,ios,linker,mach-o,Ios,Linker,Mach O,我试图向我的项目中添加一个testunit目标,但失败了。 我的测试单元需要libxml2.dylib,实际上是libxml2.2.dylib,当然还有sentestingunit.framework。 我在构建设置中将libxml2.dylib添加到框架搜索路径中 $inherited$SYSTEM\u APPS\u DIR/Xcode.app/Contents/Developer/Library/Frameworks 然后我在构建阶段->将二进制文件链接到库中添加sentestingunit

我试图向我的项目中添加一个testunit目标,但失败了。 我的测试单元需要libxml2.dylib,实际上是libxml2.2.dylib,当然还有sentestingunit.framework。 我在构建设置中将libxml2.dylib添加到框架搜索路径中 $inherited$SYSTEM\u APPS\u DIR/Xcode.app/Contents/Developer/Library/Frameworks

然后我在构建阶段->将二进制文件链接到库中添加sentestingunit.framework。 我有一个名为vindfyrar的应用程序作为目标依赖项。 现在,我的测试目标的构建开始尖叫下面所有的东西; 有人知道我做错了什么吗? i386?为什么?

请相信我,我已经完成了我的家庭作业,我在谷歌上搜索并尝试构建设置中可能出错的每个选项。。。没有成功。 狮子座10.7.5上的XCode 4.6

亲切问候,, 简·吉瓦尔斯

Ld/Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator/DavisTest.octest/DavisTest-normal i386 cd/Users/jan/utveckling/vivasjofart/vivasjofart setenv IPHONEOS_部署_目标6.1 setenv PATH/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/sbin:/sbin /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-arch i386-bundle-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk-L/Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator-L/Users/jan/utveckling/vivasjofart/L/Users/jan/utveckling/vivasjofart/../coreplot示例/DatePlot-L/Developer/Platforms/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib-F/Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakxnlwqcelyrhdyifmtf/Build/Products/Debug iphonesimulator-F/Applications/Xcode.app/Contents/Developer/Library/Frameworks-filelist/Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkhnlwqceslyrhdyifmtf/Build/Intermediates/vivasjofart.Build/Debug-iphonesimulator/DavisTest.Build/Objects-normal/i386/DavisTest.LinkFileList-bundle\u/用户/ Java/XVCOD/VIVAJOFART,DVIMGEGAKXNWLQQFS/Bug构建/产品/调试IpOnSimulula/Vdffyr.App/Vdffyrar - Xlinker -ObjcAbIIAL版本-XLink 2 - FOBC链接运行时- Xlinker - Noi-EnimyPyDyLIPS-MIOS模拟器版本MIN=6.1 -框架SENTestIGKIT -框架UIKIT框架基础-O/Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator/DavisTest.octest/DavisTest

ld:警告:忽略文件/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/bundle1.o,文件/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/bundle1.o中缺少必需的体系结构i386 ld:警告:忽略文件/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.dylib,文件/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.dylib中缺少所需的体系结构i386 ld:警告:忽略文件/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libSystem.dylib,在文件/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/libSystem.dylib2中缺少必需的体系结构i386 ld:in'/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.A.dylib',在/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/libobjc.A.dylib文件中缺少架构i386所需的架构i386 clang:错误:链接器命令失败,退出代码为1使用-v查看调用


您正在链接iPhoneOS SDK,其中所有二进制文件都是为arm架构构建的,但您正在构建一个iPhone模拟器程序i386。您的项目链接到错误的SDK。

我通过添加这些设置和值解决了问题

对于测试主机,它是$BUNDLE\u LOADER 对于Bundle Loader,它是$build\u PRODUCTS\u DIR/ApplicationName.app/ApplicationProductName

如果需要更多详细信息,请登录apple.developer并搜索 测试用例给出苹果Mach-O连接器错误

谢谢大家抽出时间

亲切问候,, Jan Gifvars

好的,谢谢Jason。我的构建设置是ARCHS==标准armv7、armv7s和SDKROOT==iOS 6.1支持的平台==iOS和有效的_ARCHS==armv7。是否有其他设置使我的目标成为i386目标?当我添加SentTestingKit框架时,框架搜索路径设置为上面所示。如果我删除那个条目。当然,除句子参考文献外,编译将成功
. 拜托,有什么想法吗?对不起,我错过了这些设置标题搜索路径$SDKROOT/usr/include/libxml2/**库搜索路径$SRCROOT$SRCROOT/./../coreplot examples/DatePlot/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/libFRAMEWORK\u SEARCH\u path$inherited$SYSTEM\u APPS\u DIR/Xcode.app/Contents/Developer/Library/frameworks请稍候,我想我要解决这个问题了。。。我会让你知道的。不,我不明白。我跟踪了这个链接。我在哪里声明我想要一个i386架构,请注意这很烦人