[英]java Opencv unsatisfiedLinkError, native Library is loaded
I am trying to run some program on opencv, but I am getting this error:我正在尝试在 opencv 上运行一些程序,但出现此错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0(Ljava/lang/String;)J
I have already loaded the library, libopencv_java310.so by using this code:我已经使用以下代码加载了库 libopencv_java310.so:
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
I have also added the path to the native library.我还添加了本地库的路径。
I have searched a lot on the internet, but the only reason this error comes, is due to native library is not loaded.我在互联网上搜索了很多,但出现此错误的唯一原因是未加载本机库。 What could be the other reason of getting this error.
出现此错误的其他原因可能是什么。
Can anyone help....!谁能帮帮忙....! Any help will be appreciated.
任何帮助将不胜感激。
you might move your System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
你可能会移动你的
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
to a static block so the dll gets loaded before any instruction of opencv .到静态块,以便在 opencv 的任何指令之前加载 dll。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.