Search code examples
iosxcodecocoapodscocoalumberjack

Link error for library added with CocoaPods


I added PaperTrailLumberjack to my project by adding the line pod 'PaperTrailLumberjack' to my Podfile.

I then ran the pod install command and got the following:

Analyzing dependencies
Downloading dependencies
Installing AFNetworking 2.1.0 (was 2.1.0)
Installing CocoaAsyncSocket (7.3.5)
Installing CocoaLumberjack (1.8.1)
Installing PaperTrailLumberjack (0.1.0)
Generating Pods project
Integrating client project

It seems to go well and I also get the correct targets in my Pods project. I can also import DDLog.h and I even get macros like DDLogVerbose suggested by intellisense.

However, when I compile my project I get an error:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_DDLog", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am hoping that I am just forgetting something silly since it's late and I am tired. But the settings for the pod targets are the same as those for the target for AFNetworking, and that one is working fine.


Solution

  • Something must have gone wrong during the CocoaPods install because I have solved the problem by simply removing PaperTrailLumberjack from my podfile and running pod install. It said:

    Analyzing dependencies
    Removing CocoaAsyncSocket
    Removing CocoaLumberjack
    Removing PaperTrailLumberjack
    

    I then added it again and ran pod install where it said:

    Downloading dependencies
    Using AFNetworking (2.1.0)
    Installing CocoaAsyncSocket (7.3.5)
    Installing CocoaLumberjack (1.9.0)
    Installing PaperTrailLumberjack (0.1.0)
    Generating Pods project
    Integrating client project
    

    It is now working fine.