Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

library not found for -lPods

I got an error when archiving a project. This is my environment.

  • Mac OS Lion
  • Xcode 4.3.1
  • iOS SDK 5.1

The project deployment target is:

IPHONEOS_DEPLOYMENT_TARGET 3.2

The error shows:

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

I guess Pods is CocoaPods that I used to manage XCode project dependencies. https://github.com/CocoaPods/CocoaPods

This is my Podfile

platform :ios  
dependency 'libPusher', '1.1'

I am not sure what the error means?

like image 513
angelokh Avatar asked Mar 25 '12 20:03

angelokh


3 Answers

Are you opening the workspace (that was generated by CocoaPods) instead of the xcodeproj?

like image 140
alloy Avatar answered Sep 21 '22 22:09

alloy


I separated the app and the test targets in the Podfile by using

target :App do
    …
end

target :AppTests do
    …
end

This resulted in two new products libPods-App.a and libPods-AppTests.a, respectively and they made the previous product libPods.a obsolete. I had to remove this product from the Link Binary With Libraries Section of the Build Phases configuration of both targets.

like image 172
Andras Hatvani Avatar answered Sep 19 '22 22:09

Andras Hatvani


I ran into a similar problem today.

  1. I setup a new project
  2. I installed cocoa pods
  3. I created a new configuration Preview along with the existing Debug and Release
  4. Now when compiling on this new Preview configuration, the compiler would not be able to link with Pods and giving me this message:

    ld: library not found for -lPods
    

The solution:

What I had to do was to run

 pod install

again and thus configuring cocoapods for the new Preview configuration. It updated my project, the workspace and the Pod's project file and the problem disappeared

like image 120
Besi Avatar answered Sep 22 '22 22:09

Besi