Xcode Compiler Error: ld: library not found for -lPods

送分小仙女□ 提交于 2019-12-25 02:56:13

问题


I'm trying to use the pod library to the project "BC LitterBox", after install pod according to http://cocoapods.org/ and Complier LitterBox, I'm now down to 1 compilation error, which I can't seem to get rid of.

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

Anyone know what could be causing this?


回答1:


When you install a pod, CocoaPods creates a new workspace that includes your project and whatever pod(s) you installed.

You'll have to close your project and open that workspace.




回答2:


Make sure you are opening the .xcworkspace file, not the .xcodeproj




回答3:


You can perform this steps:

  • Close .xcworkspace and .xcproject (Xcode Projects);
  • Run pod install and pod update;
  • Open the new .xcworkspace;
  • Clean and Build your Project;
  • Now, you are able to run normally.



回答4:


When I try compile my project which used CocoaPods I have following linking error:

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

The reason of this problem is version of CocoaPods. Project was cloned from repo, then pods was installed. But my version of cocoapods is 1.0.1. Version of cocoapods which declared in Podfile.lock is 0.39.0.

Solution is following(In terminal):
1) Uninstall CocoaPods.
sudo gem uninstall cocoapods

2) Install version of cocoapods which declared in the Podfile.lock
sudo gem install cocoapods -v 0.39.0

3) You can check version cocoapods:
gem which cocoapods

4) Clone project then install dependencies
pod install



来源:https://stackoverflow.com/questions/21643497/xcode-compiler-error-ld-library-not-found-for-lpods

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!