我试图在Android上使用OpenCV人脸识别器,虽然我能够包装c代码我无法使其在英特尔凌动avd上工作.我不是100%肯定,但我认为标题中错误的原因是我想念/ lib / x86项目目录中的libopencv_java.so.
任何想法为什么缺少lib以及如何让它正常工作?
我的AndroID.mk看起来像:
LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)OPENCV_liB_TYPE:=SHAREDinclude /home/fat/ScaricatI/OpenCV-2.4.9-androID-sdk/sdk/native/jnI/OpenCV.mkLOCAL_MODulE := FaceDetectionPerformancesLOCAL_SRC_fileS := FaceDetectionPerformances.cppfile_List_CPP := $(wildcard $(LOCAL_PATH)/*.cpp) # finds all cpp filesOPENCV_INSTALL_MODulES:=oninclude $(BUILD_SHARED_liBRARY)
虽然我的Application.mk是
APP_STL := gnustl_staticAPP_CPPFLAGS := -frtti -fexceptionsAPP_ABI := x86 armeabi armeabi-v7aAPP_PLATFORM := androID-8
ndk-build日志是
18:32:16 **** auto Build of configuration Default for project FaceDetectionPerformances ****/home/fat/androID-ndk-r9d/ndk-build NDK_DEBUG=1 all AndroID NDK: WARNING:jni/AndroID.mk:FaceDetectionPerformances: non-system librarIEs in linker flags: -lopencv_java AndroID NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_liBRARIES AndroID NDK: or LOCAL_SHARED_liBRARIES instead to List the library dependencIEs of the AndroID NDK: current module [x86] Gdbserver : [x86-4.6] libs/x86/gdbserver[x86] Gdbsetup : libs/x86/gdb.setup[armeabi] Gdbserver : [arm-linux-androIDeabi-4.6] libs/armeabi/gdbserver[armeabi] Gdbsetup : libs/armeabi/gdb.setup[armeabi-v7a] Gdbserver : [arm-linux-androIDeabi-4.6] libs/armeabi-v7a/gdbserver[armeabi-v7a] Gdbsetup : libs/armeabi-v7a/gdb.setup[x86] Compile++ : FaceDetectionPerformances <= FaceDetectionPerformances.cpp[x86] Sharedlibrary : libFaceDetectionPerformances.so[x86] Install : libFaceDetectionPerformances.so => libs/x86/libFaceDetectionPerformances.so[armeabi] Compile++ thumb: FaceDetectionPerformances <= FaceDetectionPerformances.cpp[armeabi] Sharedlibrary : libFaceDetectionPerformances.so[armeabi] Install : libFaceDetectionPerformances.so => libs/armeabi/libFaceDetectionPerformances.so[armeabi] Install : libopencv_java.so => libs/armeabi/libopencv_java.so[armeabi-v7a] Compile++ thumb: FaceDetectionPerformances <= FaceDetectionPerformances.cpp[armeabi-v7a] Sharedlibrary : libFaceDetectionPerformances.so/home/fat/androID-ndk-r9d/toolchains/arm-linux-androIDeabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androIDeabi/4.6/../../../../arm-linux-androIDeabi/bin/ld: warning: hIDden symbol '__aeabi_atexit' in /home/fat/androID-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a(atexit_arm.o) is referenced by DSO ./obj/local/armeabi-v7a/libopencv_java.so[armeabi-v7a] Install : libFaceDetectionPerformances.so => libs/armeabi-v7a/libFaceDetectionPerformances.so[armeabi-v7a] Install : libopencv_java.so => libs/armeabi-v7a/libopencv_java.so1
8:32:37建成(耗时20s.952ms)
更新1
opencvAndroIDSdk包为x86 arch提供了共享库libopencv_java,但是ndk在构建时不会将它移动到libs / x86目录,而是为armeabi arch.我还尝试将它从/OpenCV-2.4.9-androID-sdk/sdk/native/libs/x86/libopencv_java.so手动移动到/ libs / x86项目子目录,但是当我构建项目时,ndk删除文件.
以上是内存溢出为你收集整理的Opencv Android:java.lang.UnsatisfiedLinkError:dlopen失败:无法加载库“libopencv_java.so”全部内容,希望文章能够帮你解决Opencv Android:java.lang.UnsatisfiedLinkError:dlopen失败:无法加载库“libopencv_java.so”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)