标签:android include ndk配置文件 源文件
1, eclipse 新建android项目,添加jni目录,配置ndk
2,jni目录下新建第三方库的引用源文件目录,包含各个平台的so包以及对应的头文件
3,配置Android.mk
第三方库引用的配置文件如:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := 引用库别名
LOCAL_SRC_FILES :=$(TARGET_ARCH_ABI)/引用库文件名称.so
include $(PREBUILT_SHARED_LIBRARY)
主引用Android.mk文件内容:
TOP_LOCAL_PATH :=$(call my-dir)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(TOP_LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE:= 生成库文件名称
LOCAL_SHARED_LIBRARIES := \
引用库别名
LOCAL_SRC_FILES :=\
XXXX.cpp\
XXXX.cpp
LOCAL_LDLIBS += -llog
include $(BUILD_SHARED_LIBRARY)
so库编译命令:
ndk-build APP_ABI="armeabi armeabi-v7a x86 mips"
标签:android include ndk配置文件 源文件
原文地址:http://ronj2d.blog.51cto.com/4887867/1653062