Gurinderbeer Singh
Gurinderbeer Singh

Reputation: 386

java Opencv unsatisfiedLinkError, native Library is loaded

I am trying to run some program on opencv, but I am getting this error:

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:

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.

Upvotes: 1

Views: 433

Answers (1)

Abdou Amari
Abdou Amari

Reputation: 66

you might move your System.loadLibrary(Core.NATIVE_LIBRARY_NAME); to a static block so the dll gets loaded before any instruction of opencv .

Upvotes: 1

Related Questions