android ndk 怎样调用第三方的so库文件
1个回答
展开全部
1.在project/jni目录下创建prebuilt子目录(目录名可自定义).
2.将第三方.so放到prebuilt中,并创建Android.mk, 内容如下:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := xxx
LOCAL_SRC_FILES := libxxx.so
include $(PREBUILT_SHARED_LIBRARY)
3.在project/jni/Android.mk中加入
LOCAL_SHARED_LIBRARIES := xxx
4.在project/jni/android.mk的最后加入
include $(LOCAL_PATH)/prebuilt/Android.mk
5.运行cygwin, 到project目录下, 运行$NDK/ndk-build
2.将第三方.so放到prebuilt中,并创建Android.mk, 内容如下:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := xxx
LOCAL_SRC_FILES := libxxx.so
include $(PREBUILT_SHARED_LIBRARY)
3.在project/jni/Android.mk中加入
LOCAL_SHARED_LIBRARIES := xxx
4.在project/jni/android.mk的最后加入
include $(LOCAL_PATH)/prebuilt/Android.mk
5.运行cygwin, 到project目录下, 运行$NDK/ndk-build
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询