问题
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
andpod update
; - Open the new
.xcworkspace
; Clean
andBuild
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.locksudo gem install cocoapods -v 0.39.0
3) You can check version cocoapods:gem which cocoapods
4) Clone project then install dependenciespod install
来源:https://stackoverflow.com/questions/21643497/xcode-compiler-error-ld-library-not-found-for-lpods