-
My env:
Ubuntu 16.04, java 18, opencv 4.5.5, gcc-7 -
My opencv has built, and I have the libopencv-java455.so
-
Code for reproduce, I can promise the path of
libopencv-java455.so
is right(which is set in $LD_LIBRARY_PATH)
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.CvType;
import org.opencv.core.Scalar;
import org.opencv.videoio.VideoCapture;
class Hello {
static{
System.loadLibrary("opencv_java455"); }
public static void main(String[] args) {
VideoCapture cap = new VideoCapture("");
}
}
-
command(~/workspace/opencv/opencv-4.5.5/build/bin/opencv-455.jar is opencv jar path)
java -cp ~/workspace/opencv/opencv-4.5.5/build/bin/opencv-455.jar Hello.java -
Error log:
Exception in thread “main” java.lang.UnsatisfiedLinkError: ‘long org.opencv.videoio.VideoCapture.VideoCapture_2(java.lang.String)’ -
Check the symbol table:
00000000001105e0 g F .text 00000000000002a6 Java_org_opencv_videoio_VideoCapture_VideoCapture_12
which is right.
So I am very confused. I am new to Java, please help.