使用Android.mk添加两个预先构建的静态和共享库

时间:2018-02-12 16:12:50

标签: android-ndk shared-libraries static-libraries android.mk prebuild

我正在尝试使用Android.mk将Dlib和超级大国库添加到我的android项目中。我使用Android.mk包含了成功的预建共享Dlib库(.so文件),但是当我尝试将超级大国添加为静态库(包有.a文件和CMakeLists.txt)时,我面临着关于喜欢JNI的问题用java函数。我不能在java中使用JNI函数。如果有人可以帮助我,我将不胜感激。这是我的Android.mk文件:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := libs
LOCAL_SRC_FILES := /[MyProjectAddress]/app/libs/$(TARGET_ARCH_ABI)/libdlib.so
LOCAL_EXPORT_C_INCLUDES := /[MyDLIBFileAddress]/dlib_v19.7/dlib
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := superpoweredLib
LOCAL_SRC_FILES := /[MyProjectAddress]/app/libs/$(TARGET_ARCH_ABI)/libSuperpoweredAndroid$(TARGET_ARCH_ABI).a
LOCAL_EXPORT_C_INCLUDES := /[SuperpoweredFileAddress]/SuperpoweredSDK/Superpowered/AndroidIO/SuperpoweredAndroidAudioIO.cpp \ /[SuperpoweredFileAddress]/SuperpoweredSDK/Superpowered \ 
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := FrequencyDomain
LOCAL_LDFLAGS := -Wl,--build-id
LOCAL_LDLIBS += -llog -ldl
LOCAL_SRC_FILES := \ /[MyProjectAddress]/app/src/main/jni/FrequencyDomain.cpp \

LOCAL_C_INCLUDES += /[MyProjectAddress]/app/src/debug/jni                 
LOCAL_C_INCLUDES += /[MyProjectAddress]/app/src/main/jni

LOCAL_SHARED_LIBRARIES := libs
include $(BUILD_SHARED_LIBRARY)

LOCAL_SHARED_LIBRARIES := superpoweredLib
include $(BUILD_SHARED_LIBRARY)

0 个答案:

没有答案