InsightFaceRecognition_Demo_AndroidNCNN
InsightFaceRecognition_Demo_AndroidNCNN copied to clipboard
"libomp.so" not found
2020-04-15 10:46:22.481 17465-17465/com.chenty.ncnninsightface D/AndroidRuntime: Shutting down VM
2020-04-15 10:46:22.483 17465-17465/com.chenty.ncnninsightface E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.chenty.ncnninsightface, PID: 17465
java.lang.UnsatisfiedLinkError: dlopen failed: library "libomp.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
at com.chenty.testncnn.CameraNcnnFragment.
安装百度网盘的是可以正常运行的,看apk上传日期是19年;代码最新应该是3月份,是否更新库的时候存在一些兼容问题,导致找不到libomp.so; 多谢大佬
openmp是系统库 你可以百度下 cmake里面加个参数就可以------------------ Original ------------------ From: "李仕涛"[email protected] Date: Wed, Apr 15, 2020 11:20 AM To: "chentyjpm/InsightFaceRecognition_Demo_AndroidNCNN"[email protected]; Cc: "Subscribed"[email protected]; Subject: Re: [chentyjpm/InsightFaceRecognition_Demo_AndroidNCNN] "libomp.so"not found (#1)
安装百度网盘的是可以正常运行的,看apk上传日期是19年;代码最新应该是3月份,是否更新库的时候存在一些兼容问题,导致找不到libomp.so; 多谢大佬
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
尝试添加了 还是报缺少这个so;现有代码,你安装到安卓设备上可以运行吗? 这个是加了的cmake
cmake_minimum_required(VERSION 3.4.1)
#include头文件目录 include_directories(src/main/cpp/include src/main/cpp/)
#source directory源文件目录 file(GLOB FACE_SRC src/main/cpp/.h src/main/cpp/.cpp) set(FACE_COMPILE_CODE ${FACE_SRC})
#添加ncnn库 add_library(libncnn STATIC IMPORTED ) set_target_properties(libncnn PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libncnn.a)
FIND_PACKAGE( OpenMP REQUIRED) if(OPENMP_FOUND) message("OPENMP FOUND") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") endif()
#编译为动态库 add_library(Face SHARED ${FACE_COMPILE_CODE})
#添加工程所依赖的库 find_library( log-lib log ) target_link_libraries( Face libncnn jnigraphics z ${log-lib} )
好了,是ndk版本问题,换成17就好了
好了,是ndk版本问题,换成17就好了
Thx a lot! NDK 17 version solve the problem.
I have the same problem too.
same problem when build https://github.com/chentyjpm/MobileNetSSD_Demo_AndoridNCNN
I download the NDK 17 version from https://developer.android.google.cn/ndk/downloads/older_releases
and then set the Android Sutdio project NDK folder to 17 folder, and the problem solved.