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

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'

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


当前回答

try

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

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

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

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

其他回答

我有一个旧的libPod。指定的文件(可能是我更改目标造成的)。

项目设置->构建阶段->链接二进制库

通常,cocoapods只包含一个库,比如libPods-target。或libPods.a。我通过移除副本解决了这个问题。

重命名some_project。工作空间文件到some_project.workspace。备份并运行$pod install。它创建了一个新的工作空间文件,错误就消失了。

如果Xcode在链接时报错,例如Library not found for -lPods,它不会检测到隐式依赖。

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 /Pods/. If it is empty (it should not be), verify that the ~/.cocoapods/master//.podspec has the correct git hub 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”.

http://docs.cocoapods.org/guides/getting_started.html

我也有,Cocoapods版本0.28.0

这里很简单,不需要冗长的阅读: -卸载Cocoapods(命令行或AppCode) -删除Podfile, Podfile。锁,Pods文件夹

重新安装Cocoapods 启动新创建的工作空间。

只有将“库搜索路径”(在“MyProject”的构建设置中)添加到“Pods/ Build / debug - iphonessimulator”中才对我有效(当使用模拟器时)。

从这里开始: https://github.com/CocoaPods/CocoaPods/issues/121#issuecomment-5452473