views:

47

answers:

1

Hello,

I having trouble with app that uses my static libs. Here is my setup:
I have 3 libs, Utilities, Share and Misc. Share and Misc depend on Utilities. They are compiling just fine when I compile them separately. Every lib is in its own XCode project.

I want to build an app that uses features from Utilities and Share, so I added them into the project as direct dependencies. I see them listed in target "Link binary with libraries". I also see quite a lot of linking errors in the compilation results. Those error relate to 3rd parties code that is used in libraries, for example ASIHTTPRequest. Such 3rd party stuff I keep in one place and I just added path to that directory in "Header Search Paths".

Example error:

objc-class-ref-to-ASIHTTPRequest in libShare.a(SomethingThatIsInLib.o)

It's confusing because libs alone are compiling just fine but when I try to compile the app, it's throwing such errors. What am I doing wrong?

A: 

Add the -all_load and -ObjC flags to "Other Linker Flags" in the Xcode project settings.

Joshua Weinberg
I have those in libs and in app itself, they don't make any difference.
Marcin Zbijowski
hmm. Can you diagram how you have all these things laid out then? That should be fine at that point. Also a couple of exact error messages would be helpful.
Joshua Weinberg
exact errors here http://pastie.org/private/d2ptabakhot2sehztzwsa http://cl.ly/9a56a29bd2e2959b5123 http://cl.ly/ed09a242613c67a9c03bI'm using XCode 3.2.3
Marcin Zbijowski
there are 3 projects: libUtilities, libShare and the app, utilities and share use some 3rd party stuff located in separate folder, path to which is given in "header search paths", in app I'd like to use features from utilities and share libs
Marcin Zbijowski
making static libraries of static libraries compiled together is a major linking headache. I'd recommend just linking each of the components to the end goal.
Joshua Weinberg