我在做C ++中的库的OpenCV和JsonCpp朝着建立Android和iOS的库。
在测试我的库为Android,我正在做的JNI文件,但是当我尝试加载库我越来越
java.lang.UnsatisfiedLinkError中:dlopen的失败:无法找到符号“_ZN4Json6WriterD2Ev”由“libXYZ.so”引用...
那是因为我觉得我不是我建的JSON库非常好。
我用的库是这一个: https://github.com/open-source-parsers/jsoncpp
我Android.mk是:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_CAMERA_MODULES:=off
OPENCV_INSTALL_MODULES:=on
include $(LOCAL_PATH)/jsoncpp/Android.mk
include /Users/localmac/Desktop/AndroidDevelopment/OpenCV-2.4.9-android-sdk/sdk/native/jni/OpenCV.mk
OPENCV_LIB_TYPE:=SHARED
LOCAL_C_INCLUDES += $(LOCAL_PATH)
LOCAL_C_INCLUDES += /Users/localmac/mylibrary/OpenCVtry/
LOCAL_C_INCLUDES += /Users/localmac/Desktop/RD/OpenCVtry/Libraries/jsoncpp-master/include
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
LOCAL_MODULE := libXYZ
LOCAL_SRC_FILES := androidClass.cpp main.cpp utils.cpp
LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)
我不知道如何做到这一点的想法。
先感谢您。
编辑这不是NDK编译的错。
即使我编译JsonCpp,我得到的
java.lang.UnsatisfiedLinkError中:dlopen的失败:无法找到符号“_ZN4Json6WriterD2Ev”由“libXYZ.so”引用...
编辑我jsoncpp / Android.mk:
LOCAL_PATH:= $(叫我-DIR)
包括$(CLEAR_VARS)
LOCAL_CPP_EXTENSION:=的.cpp LOCAL_MODULE:= libJsoncpp
LOCAL_C_INCLUDES:= $(LOCAL_PATH)/ jsoncpp /包括
LOCAL_SRC_FILES:= SRC / lib_json / json_reader.cpp \ SRC / lib_json / json_value.cpp \ SRC / lib_json / json_writer.cpp
包括$(BUILD_SHARED_LIBRARY)