Android: combining static libraries into one
I am using Android NDK r8 to build multiple static libraries with include $ (BUILD_STATIC_LIBRARY) and I am successfully getting: lib1.a, lib2.a, lib3.a, etc.
Now I would like to combine these static libraries into one.
I'm trying to do this using ar.exe with the Android NDK:
android-ndk-r8\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\arm-linux-androideabi\bin\ar.exe r libALL.a lib1.a lib2.a lib3.a
But when I use libAll.a in Android NDK makefile it doesn't say there is no index.
How do I add this index?
Another question:
When I show the contents of the libAll.a archive , I see lib1.a , lib2.a , lib3.a instead of .o symbols from those libraries.
How can I change this (= extract .o from static libraries to merge it into libAll.a)?
thank
source to share
ar
is just an archiving tool like zip. It takes data from input files and creates an archive .a
. If you want to include all files .o
in one archive, you must specify each individual file. I don't know how to do this on WIndows, but on Linux you can use somthing like ar rs $(find . -name *.o)
.
source to share