using open3.4.0 build failed

asked 2018-12-27 22:37:16 -0500

updated 2018-12-27 23:12:38 -0500

berak gravatar image

1、I build opencv 3.4.0 in linux env, and using ndk r10d the cmake config parameter is like the following: cmake -DCMAKE_TOOLCHAIN_FILE=android.toolchain.cmake -DANDROID_NDK=/home/XXX/android-ndk-r10d -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-clang3.5 -DANDROID_STL=c++_static -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DANT_EXECUTABLE=/home/zhaoyuanbing/apache-ant-1.9.13-bin/apache-ant-1.9.13/bin/ant -DBUILD_opencv_java=ON -DBUILD_FAT_JAVA_LIB=ON -DENABLE_NEON=ON -DENABLE_VFPV3=ON ../.. then I get some shared lib

2、I link these so lib to my android native shared lib using android NDK build tools in windows and the main part about link in android.mk is like the following: LOCAL_LDFLAGS := -Wl,-z,noexecstack -L$(LOCAL_PATH)/../../../../dist/android_cloudlink_board/armeabi LOCAL_SHARED_LIBRARIES := lzma lzo HME-Audio opencv_core_so opencv_imgcodecs_so opencv_imgproc_so

include $(CLEAR_VARS) LOCAL_MODULE := opencv_core_so LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libopencv_core.so include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS) LOCAL_MODULE := opencv_imgcodecs_so LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libopencv_imgcodecs.so include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS) LOCAL_MODULE := opencv_imgproc_so LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libopencv_imgproc.so include $(PREBUILT_SHARED_LIBRARY)

3、after ld operation I build my shared lib, but there are may warning: binD/:./.android/-libndk/-gccr10d//armtoolchains-/linuxarm--androideabilinux/-4.8androideabi/-.4.8.//prebuilt/.windows/.bin//../....//armlib-/linuxgcc-androideabi//binarm/ld.exe-:l inux-androideabi/4.8/../.. /warning.:. /hidden../ armsymbol- linux'-typeinfoandroideabi /forbin /stdld.exe::: logic_errorwarning': inhidden Dsymbol: /'androidstd-:ndk:-logic_erro rr10d:/:sourceswhat/(cxx)- stlconst/'gnu -inlibstdc +D+://4.8android/-libsndk/-armeabir10d//thumbsources//libgnustl_static.acxx(-stdexcept.ostl)/ gnuis- libstdcreferenced+ +by/ 4.8 /libsDSO/ ./obj/armeabi-v7alocal//armeabithumb//libopencv_imgproc.solibgnustl_static.a (stdexcept.o) is referenced by DSO ./obj/local/armeabi-v7a/libopencv_imgproc.so D:/android-ndk-r10d/toolchains/arm-linux-androideabi-4.8/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: warning: hidden sym bol 'typeinfo for std::logic_error' in D:/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/thumb/libgnustl_static.a(stdexcept.o) is referenced by DSO ./obj/local /armeabi-v7a/libopencv_imgproc.so

4、then I push my shared lib to android os, and run my app, one fatal error is occured the jni invoked is failed
No implementation found for int com.XXX() E/UncaughtExceptionHandler: UncaughtException

so what is wrong with me?

edit retag flag offensive close merge delete