简体   繁体   中英

iphone objective c static library within static library

I am trying to distribute static lib that contain static lib (google adMob).

In my test application that uses the static library, it crashes when trying to access the static library within the static library.

Any ideas on how to distribute static library that contain static library?

10x Tamir

There is no such thing as a "static library within a static library". A static library is just a container of object files. And they are all equal.

You have two options:

  1. Distribute your own library and the third party library as two separate files. The final project then needs to include both libraries.

  2. Merge the two libraries, ie create a library that contains all your object files and the object files of the third party library. Have a look at the man pages for ar , libtool , ranlib etc. for more information.

Option 1 seems the easier one. If your static library has additional dependencies on dynamically linked libraries (such as an iOS framework or libiconv), then you'll have to provide instructions about how to add these dependencies anyway.

(I don't quite understand when and how your test app crashes. You'd have to provide more information such as the full error message and the stack trace. Normally, I'd expect that the app doesn't even build since it can't find all dependencies.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM