1

I'm writing an app that using external libraries through CocoaPods such as AFNetworking, ReactiveCocoa etc, and one static library that I wrote before. The static library also contains some external libraries from CocoaPods as well.

I've made my static library an local pod of CocoaPods and imported it as one of my pods.

However, while compiling my new app, error happened.

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

YADAClientManager is one class of my static library, and the only code that using it in my new app is in the DZPAppDelegate.m, in application:didFinishLaunchingWithOptions:

[YADAClientManager sharedClientManager];

How to solve this compiling error? And thanks in advance.

Edit:

In the Build Phrase of my app target, the Link Binary With Libraries option, I added the *.a file of my static library, such as libPods-MyApp-MyStaticLibrary.a, the problem above solved but another problem that reported missing AFNetworking and ReactiveCocoa symbols appeared.

After I added the *.a files of those libraries, problem solved.

But I do not think it is an elegant way to solve the problem.

4
  • are you compile the project from workspace? Commented Apr 22, 2014 at 23:26
  • @BryanChen I used the xcworkspace file that CocoaPods provided, and then compiled my app, so I guess I compiled the project from workspace. Commented Apr 23, 2014 at 11:22
  • I encounter the same problem, did you find your answer? Commented Jul 15, 2014 at 2:27
  • @jAckOdE I removed all the libPods-*.a files under Link Binary With Libraries and added the libPods-*.a files that I needed one by one and problem solved. Commented Jul 15, 2014 at 12:15

1 Answer 1

1

I was running into a similar issue: Modified Pod not getting compiled

I managed to find out that my Pod's source files and static library (.a) were cached in this path:

/Users/'<'username'>'/Library/Developer/Xcode/DerivedData/Example-gdaxkniovwphxbdlndbmlfqn/Build/Products/Debug-iphoneos

This path is also mentioned in your Target's : "Build Settings"> "Search Paths" > "Framework Search Paths".
I removed those cached files and my Pod was re-built with the new symbols. Took me 2 days to debug.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.