I have an Android project written in C ++ and I have a problem with the binding phase. The code is placed in some static libraries that must be linked.
I found many questions and answers online on this topic, and most of them suggest putting my libraries in LOCAL_STATIC_LIBRARIES in the Android.mk file. But, if I do this, I find that the contents of LOCAL_STATIC_LIBRARIES simply ignored: my libraries are not linked, and adding any dummy text here does not cause any error or warning messages.
I tried this as follows:
LOCAL_STATIC_LIBRARIES := MyLib.a
or with the full path:
LOCAL_STATIC_LIBRARIES := $(LOCAL_PATH)/MyLib.a
none of them worked.
If I put my static libraries in LOCAL_LDLIBS , then it will be linked, but I got a warning about non-system libraries, and probably the build will be wrong.
The contents of my Android.mk file:
LOCAL_LDLIBS := $(LOCAL_PATH)/MyLib.a ...
and I got this message:
Android NDK: WARNING:jni/Android.mk:myapp: non-system libraries in linker flags: jni/MyLib.a Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the Android NDK: current module
I could not find how to use LOCAL_STATIC_LIBRARIES , please help me!
I have android-ndk-r9 and android-sdk_r22.2.1 on OpenSuSE x86 and using target = android-18
source share