0

I am building a static library that uses AAssetManager (#include <android/asset_manager.h>) in C++ and then I will use the library from java.

The thing is I can't include libandroid because I can't use LOCAL_LDLIBS += -landroid when building static library.(local_ldlibs is always ignored for static libraries)

So how can build my static library without using local_ldlibs?

The Archetypal Paul
  • 41,321
  • 20
  • 104
  • 134

1 Answers1

1

When you build a static library, you don't need to satisfy the external references, but if somebody uses your library, they must link libandroid.so. You can put this in documentation of your library.

If you provide an Android.mk with it, you can set LOCAL_EXPORT_LDLIBS = -landroid. BTW, you can also set LOCAL_EXPORT_INCLUDES to the directory with public headers for your library.

At any rate, NDK 10 is obsolete. I strongly recommend to move to the current release (unless you desperately need support for android-3).

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307