Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot build static library with Android NDK R8

I have been building a shared library with the Android NDK and now want to build it as a static library. I assumed that all I had to do was change BUILD_SHARED_LIBRARY to BUILD_STATIC_LIBRARY in Android.mk but now when I run ndk-build, absolutely nothing happens. It just comes right back to the command prompt without displaying anything. I tried ndk-build -n and it shows 3 rm commands being executed and nothing else. I tried ndk-build -B and it makes no difference. I tried ndk-build -d and there is nothing in the output related to my source files or the name of the library.

If I change the make file back to build the shared library, it compiles the source and links the .so with no problems.

Anyone have any ideas what could be wrong?

like image 987
Jim Rhodes Avatar asked Oct 05 '22 19:10

Jim Rhodes


1 Answers

It seems that in order to build a static library, it must be a dependency of something. I was able to build my library as static by adding an Application.mk file with the following line:

APP_MODULES = mylib

like image 177
Jim Rhodes Avatar answered Oct 13 '22 12:10

Jim Rhodes