我存档一个项目时出错了。这就是我的环境。

Mac OS Lion Xcode 4.3.1 iOS SDK 5.1

项目部署目标为:

IPHONEOS_DEPLOYMENT_TARGET 3.2

错误显示:

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我猜Pods就是我用来管理XCode项目依赖的CocoaPods。 https://github.com/CocoaPods/CocoaPods

这是我的Podfile

platform :ios  
dependency 'libPusher', '1.1'

我不确定这个错误是什么意思?


当前回答

我将项目从“伙伴”重命名为“NBSelector”。

在重命名项目后,我有“libPods-Partners未找到库”错误。Xcode试图链接到旧的合作伙伴。一个文件。只要删除它,如果你有podInstalled重命名后。

其他回答

CocoaPods在GitHub上的wiki在他们的常见问题解答中有正确的答案:

Go to Product > Edit Scheme Click on Build Add the Pods static library, and make sure it's at the top of the list Clean and build again If that doesn't work, verify that the source for the spec you are trying to include has been pulled from github. Do this by looking in <Project Dir>/Pods/<Name of spec you are trying to include>. If it is empty (it should not be), verify that the ~/.cocoapods/master/<spec>/<spec>.podspec has the correct github url in it. If still doesn't work, check your XCode build locations settings. Go to Preferences -> Locations -> Derived Data -> Advanced and set build location to "Relative to Workspace".

我把这里的每个答案都看了一遍,但对我来说太简单了……转到Target -> Build Phases,然后删除libPods-YourProject。A,然后用“+”再加一次。别担心图书馆是红色的,没事的。

在这个问题中,如果你已经在你的系统中安装并更新了pod,那么你的Xcode无法找到Pods库。要解决此问题,请检查以下可能发生的原因:

您正在使用工作区。 构建Pods库。 Pods库在项目的产品组中被引用。 你的目标是在框架构建阶段的链接中包含Pods库。

try

节奏与'你的目标1','你的目标2'

我的项目成功了,目标突然停止编译。然后添加“link_with”并返回normal。

显然,现在它只是连接到第一个目标,链接是这样说的:

http://guides.cocoapods.org/syntax/podfile.html#link_with

我解决了这个问题,为我的项目设置架构和有效架构相同的所有pod。所以在我的案例中,洞的解决方案是:

更新可可荚:sudo宝石更新可可荚 更新pod:更新pod 在你的pod中,转到你的构建设置>架构,并将这里的架构和有效架构设置为与主项目相同的值。