eclipse:java.lang.UnsatisfiedLinkError

我正在研究
javacv项目,但每次我尝试声明如下矩阵:

Mat trainingData = new Mat();

我收到此错误:

Exception in thread "main" 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:447)

当我搜索解决方案时,我总是发现我必须添加:

System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

但我总是有同样的错误.

最佳答案 当应用程序尝试加载本机库并且该库不存在时,将在运行时抛出UnsatisfiedLinkError.

在附加库时听起来有些问题,或者在IDE中没有正确设置库.

见:http://docs.opencv.org/doc/tutorials/introduction/java_eclipse/java_eclipse.html#java-eclipse

点赞