我一直在尝试让 opencv 在 eclipse 中工作,并且我一直在按照本教程尝试让它在 eclipse 中工作。我已经到了创建正在运行的 .so 库的部分make -j8
。当我在 32 位 linux 系统上运行它时,它工作得很好。我得到了我需要的所有必要文件,但是当我尝试运行我的程序时,我在 Eclipse 中遇到了一个异常。
线程“主”java.lang.UnsatisfiedLinkError 中的异常:/home/joris/opencv/build/lib/libopencv_java246.so:/home/user/opencv/build/lib/libopencv_java246.so:错误的 ELF 类:ELFCLASS32(可能的原因:架构字宽不匹配)
在查找这意味着什么之后,我发现该库是 32 位的,但我的 jvm 是 64 位的。我无法更改我正在使用的 jvm,因此我需要以 64 位构建我的本机库。
我现在尝试在 64 位系统上构建 opencv 库,但我无法找到在 32 位系统上构建它时获得的 libopencv_java246.so 文件。
user@BEL-8WF4XW1:~$ find /home/user/opencv/ -name *.so
/home/user/opencv/3rdparty/lib/mips/libnative_camera_r4.0.3.so
/home/user/opencv/3rdparty/lib/mips/libnative_camera_r4.2.0.so
/home/user/opencv/3rdparty/lib/mips/libnative_camera_r4.1.1.so
/home/user/opencv/3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
/home/user/opencv/3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
/home/user/opencv/3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
/home/user/opencv/3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
/home/user/opencv/3rdparty/lib/armeabi-v7a/libnative_camera_r4.2.0.so
/home/user/opencv/3rdparty/lib/armeabi-v7a/libnative_camera_r4.1.1.so
/home/user/opencv/3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
/home/user/opencv/3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
/home/user/opencv/3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
/home/user/opencv/3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
/home/user/opencv/3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
/home/user/opencv/3rdparty/lib/armeabi/libnative_camera_r4.2.0.so
/home/user/opencv/3rdparty/lib/armeabi/libnative_camera_r4.1.1.so
/home/user/opencv/3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
/home/user/opencv/3rdparty/lib/x86/libnative_camera_r2.3.3.so
/home/user/opencv/3rdparty/lib/x86/libnative_camera_r4.0.3.so
/home/user/opencv/3rdparty/lib/x86/libnative_camera_r3.0.1.so
/home/user/opencv/3rdparty/lib/x86/libnative_camera_r4.2.0.so
/home/user/opencv/3rdparty/lib/x86/libnative_camera_r4.1.1.so
用户@BEL-8WF4XW1:~$
我不明白为什么它可以在 32 位系统上工作,但不能在 64 位系统上工作。谁能帮我理解?