O链接器错误

我试图给我的项目添加一个testunit目标,但是失败了。 我的testunit需要libxml2.dylib(实际上是libxml2.2.dylib),当然还有sentestingunit.framework。 我将libxml2.dylib添加到构建设置中的FRAMEWORK_SEARCH_PATHS $(继承)“$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks”

然后我在构建阶段添加sentestingunit.framework - >链接二进制库。 我有我的应用程序(称为vindfyrar)作为目标依赖项。 现在我的测试目标的构建开始尖叫所有下面的东西; 任何人都知道我做错了什么? i386的? 为什么?

在我看来,我已经完成了我的作业,例如使用Google搜索并尝试每个选项都可能是错误的构建设置...没有成功。 XCode 4.6在Lion 10.7.5上

亲切的问候,简吉弗斯

Ld /Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator/DavisTest.octest/DavisTest normal i386 cd / Users / jan / utveckling / vivasjofart / vivasjofart setenv IPHONEOS_DEPLOYMENT_TARGET 6.1 setenv PATH“ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/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 -dvimgeakkxnlwqceslyrhdyifmtf / Build / Products / Debug-iphonesimulator -L / Users / jan / utveckling / vivasjofart / vivasjofart -L /用户/ jan / utveckling / vivasjofart / vivasjofart /../../ coreplot-examples / DatePlot -L / Developer / Platforms / iPhoneOS.platform / DeviceSupport / 4.2 / Sy mbols / usr / lib -L ​​/ Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS4.3.sdk / usr / lib -F / Users / jan / Library / Developer / Xcode / DerivedData / vivasjofart -dvimgeakkxnlwqceslyrhdyifmtf / Build / Products / Debug-iphonesimulator -F / Applications / Xcode.app / Contents / Developer / Library / Frameworks -filelist /Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Intermediates/vivasjofart.build/Debug- iphonesimulator / DavisTest.build / Objects-normal / i386 / DavisTest.LinkFileList -bundle_loader /Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator/vindfyrar.app/vindfyrar -Xlinker - objc_abi_version -Xlinker 2 -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min = 6.1 -framework SenTestingKit -framework UIKit -framework Foundation -o / Users / jan / Library / Developer / Xcode / DerivedData / vivasjofart- dvimgeakkxnlwqceslyrhdyifmtf /编译/产品/调试-iphonesimulator / DavisTest.octest / DavisT 美东时间

ld:警告:忽略文件/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/bundle1.o,在文件/Developer/Platforms/iPhoneOS.platform/Developer/中缺少必需的架构i386 SDKs / iPhoneOS4.3.sdk / usr / lib / bundle1.o(2个片段)ld:警告:忽略文件/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.dylib,缺少必需架构i386在文件/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.dylib(2个片段)中ld:warning:忽略文件/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols /usr/lib/libSystem.dylib,在文件/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libSystem.dylib(2个片)中缺少必需的体系结构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/lib/libobjc.Ad中缺少必需的体系结构i386 ylib(2个slice)用于架构i386 clang:错误:linker命令失败,退出代码1(使用-v查看调用)


您正在链接iPhoneOS SDK(其中所有的二进制文件都是为架构臂构建的),但是您正在构建iPhone Simulator程序(i386)。 您的项目与错误的SDK链接。


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

对于测试主机,它是$(BUNDLE_LOADER)对于Bundle Loader,它是$(BUILT_PRODUCTS_DIR)/ApplicationName.app/ApplicationProductName

如果您想了解更多详细信息,请登录到apple.developer并搜索“测试案例给予Apple Mach-O链接器错误”

感谢大家的时间!

亲切的问候,简吉弗斯

链接地址: http://www.djcxy.com/p/52455.html

上一篇: O Linker Error

下一篇: accelerate x264 encoding