Cannot Build Local Shared Library In Android Ndk
Solution 1:
Android NDK supports pthread
s, but does not provide libpthread as usual in Linux toolchains. Your first error message will be gone if you use
LOCAL_CFLAGS += -DHAVE_PTHREADS
and not add LOCAL_LDLIBS += -lpthread
Regarding the undefined reference to do_copy()
, it comes from system library libutils.so
. It is not safe to use libraries that are not officially published with NDK (see more here), so you better rewrite this piece of code.
Probably you received your Android.mk
file from the google source or one of its forks. I doubt that the resulting library will be useable, because the original libbinder.so
requires system app with elevated permissions will be loaded when your app starts.
Anyways, referring to system libraries as LOCAL_SHARED_LIBRARIES
does not work with ndk-build
. Instead of you are expected to writeLOCAL_SHARED_LIBRARIES := liblog libcutils libutils
LOCAL_LDLIBS += -llog -lcutils -lutils
Post a Comment for "Cannot Build Local Shared Library In Android Ndk"