Using Matlab with Java and JNI, I'm getting an UnsatisfiedLinkError that I cannot fathom.
First I load a native library from the Matlab command line. It works:
>> java.lang.System.load('/usr/local/share/OpenCV/java/libopencv_java.so')
Then I call a Java function implemented with the native library:
>> org.opencv.core.Mat
Java exception occurred:
java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_Mat()J
at org.opencv.core.Mat.n_Mat(Native Method)
at org.opencv.core.Mat.<init>(Mat.java:441)
It's complaining it can't find org.opencv.core.Mat.n_Mat()J, but that symbol is in the .so:
echristiansen@jnu:/usr/local/share/OpenCV/java$ nm libopencv_java.so | grep Mat_n_1Mat
0000000000027780 T Java_org_opencv_core_Mat_n_1Mat__
00000000000316c0 T Java_org_opencv_core_Mat_n_1Mat__DDI
00000000000312a0 T Java_org_opencv_core_Mat_n_1Mat__DDIDDDD
00000000000318a0 T Java_org_opencv_core_Mat_n_1Mat__III
00000000000314b0 T Java_org_opencv_core_Mat_n_1Mat__IIIDDDD
0000000000030fa0 T Java_org_opencv_core_Mat_n_1Mat__JII
0000000000031120 T Java_org_opencv_core_Mat_n_1Mat__JIIII
So if it's loading the native library with the correct symbol, why am I getting an UnsatisifiedLinkError?