当在Xcode 4.2中构建归档时,three20相关的clang链接错误

问题描述:

当我构建归档文件时,出现以下错误。我的应用程序适合模拟器。当在Xcode 4.2中构建归档时,three20相关的clang链接错误

Ld "/Users/me/Library/Developer/Xcode/DerivedData/ProjectName-gflmmwtgzbpnsacgrofxwujnipkm/ArchiveIntermediates/app_core/InstallationBuildProductsLocation/Applications/ProjectName.app/ProjectName" normal armv7 
    cd /Users/me/Documents/pn-core-iphone-app 
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.0 
    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/clang++ -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -L/Users/me/Library/Developer/Xcode/DerivedData/ProjectName-gflmmwtgzbpnsacgrofxwujnipkm/ArchiveIntermediates/app_core/BuildProductsPath/Adhoc_Distro-iphoneos -L/Users/me/Documents/pn-core-iphone-app/External/OAuthConsumer -F/Users/me/Library/Developer/Xcode/DerivedData/ProjectName-gflmmwtgzbpnsacgrofxwujnipkm/ArchiveIntermediates/app_core/BuildProductsPath/Adhoc_Distro-iphoneos -F/Users/me/Documents/pn-core-iphone-app/External/GHUnit -filelist "/Users/me/Library/Developer/Xcode/DerivedData/ProjectName-gflmmwtgzbpnsacgrofxwujnipkm/ArchiveIntermediates/app_core/IntermediateBuildFilesPath/ProjectName.build/Adhoc_Distro-iphoneos/app_core.build/Objects-normal/armv7/ProjectName.LinkFileList" -dead_strip -ObjC -liconv.2 -lxml2 -miphoneos-version-min=4.0 /Users/me/Library/Developer/Xcode/DerivedData/ProjectName-gflmmwtgzbpnsacgrofxwujnipkm/ArchiveIntermediates/app_core/BuildProductsPath/Release-iphoneos/libThree20.a -lThree20Core -lThree20Network -lThree20Style -lThree20UI -lThree20UICommon -lThree20UINavigator -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreLocation -framework SystemConfiguration -framework MapKit -framework CFNetwork -weak_framework AVFoundation -framework MessageUI -framework Security -weak_framework CoreVideo -weak_framework CoreMedia -framework QuartzCore -framework AudioToolbox -framework MobileCoreServices -lz.1.1.3 -weak_framework CoreTelephony -lOAuth -liconv /Users/me/Library/Developer/Xcode/DerivedData/ProjectName-gflmmwtgzbpnsacgrofxwujnipkm/ArchiveIntermediates/app_core/BuildProductsPath/Release-iphoneos/libZXingWidget.a -framework AddressBook -framework AddressBookUI -o "/Users/me/Library/Developer/Xcode/DerivedData/ProjectName-gflmmwtgzbpnsacgrofxwujnipkm/ArchiveIntermediates/app_core/InstallationBuildProductsLocation/Applications/ProjectName.app/ProjectName" 

ld: library not found for -lThree20Core 
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ failed with exit code 1 

我想我只是不知道关于铿锵声和建立一般的命令。在-lThree20Core之前出现的派生路径是否对可以阅读此命令的人感到有趣? (我会认为应该在它前面有一个-L)

我已验证我的标题搜索路径是否正确,根据此博文http://www.amirnaor.com/?p=112,但我在项目更新后添加了three20项目,所以看起来不是问题。

任何人都知道问题可能在这里?

如果您的应用程序无法在真实设备上与Xcode一起运行,那么这意味着您的Three20Core库没有iOS设备上处理器的二进制数据,仅适用于Mac处理器。如果您发现libThree20Core.a文件或什么每次调用,然后在“终端应用”型

> file <path-to-binary>/libThree20Core.a 

你应该会看到类似这样的

<path-to-binary>/libThree20Core.a (for architecture armv6): current ar archive random library 
<path-to-binary>/libThree20Core.a (for architecture armv7): current ar archive random library 
<path-to-binary>/libThree20Core.a (for architecture i386): current ar archive random library 

的东西,如果你是编译libThree20Core.a您自己需要为所有三种体系结构创建一个版本。我还没有弄清楚如何在Xcode中完全做到这一点,你似乎只能瞄准,Mac处理器或iOS处理器不是两者兼而有之。你可以做的是建立两次一次的Mac和一次iOS的库。使用荔波命令行工具

> lipo -create -output libThree20Core.a libThree20Core_x86.a libThree20Core_arm.a 

你可以尝试交替设立的Xcode使用不同的库搜索根据目标架构路径可以将它们合并两成一个单一的某文件。

+0

不幸的是,这个答案现在完全不可测。我最终得到了应用程序来编译这两个,但我尝试了很多东西,我不知道我做了什么来解决这个问题。作为唯一的答案,你的选中标记! – livingtech