开发者

iPhone static library linking problem

开发者 https://www.devze.com 2023-01-06 08:59 出处:网络
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 sep

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开发者_JS百科 when I try to compile the app, it's throwing such errors. What am I doing wrong?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号