NDK 不能编译静态库
照着NDK文档编译静态库一点效果也没有,google一下。
解决办法有两种:
1、在Android.mk并行目录增加 Application.mk
文件内容:
APP_ABI := armeabi
APP_PLATFORM := android-9
APP_MODULES := libdvnca
2、在Android.mk中增加使用静态库的编译选项
include $(CLEAR_VARS)
LOCAL_MODULE := libdvnca
LOCAL_SRC_FILES := \
src/dvn_cak.c \
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/inc \
LOCAL_CFLAGS += -D__ANDROID__ -DTEST_IPANEL -DUSE_GRAPHICS_PIXEL_ALPHA -DHAVE_GFX_2D
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := test
LOCAL_STATIC_LIBRARIES := libdvnca
LOCAL_CFLAGS += -D__ANDROID__ -DTEST_IPANEL -DUSE_GRAPHICS_PIXEL_ALPHA -DHAVE_GFX_2D
include $(BUILD_SHARED_LIBRARY)
如此控制台输入的打印为:
StaticLibrary : libdvnca.a
SharedLibrary : libtest.so
Install : libtest.so => libs/armeabi/libtest.so