0

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

1
  • You have to link separately all the static libs that your project needs. A static lib can not include any other lib; for that you need a dynamic lib. Commented Dec 26, 2011 at 16:01

1 Answer 1

1

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, i.e. 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.)

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.