linux下使用JNA调用libopencv_java2413.so报错 5C

(。so放在linux/user/lib下,环境变量已配好)
测试代码
import com.sun.jna.Library;

import com.sun.jna.Native;

public class Main1 {

public interface Clibrary extends Library {  

    Clibrary INSTANTCE = (Clibrary) Native.loadLibrary("opencv_java2413",  
            Clibrary.class);  


    long n_eye(int rows, int cols, int type);  

}  

public static void main(String[] args) {  

    System.out.println(Clibrary.INSTANTCE.n_eye(3, 3, 2));   
}  

}

linux命令:
java -cp /home/jna.jar:/home Main1

报错信息

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load librar
y 'opencv_java2413': libavcodec.so.54: cannot open shared object file: No such f
ile or directory

at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)

at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)

at com.sun.jna.Library$Handler.(Library.java:140)

at com.sun.jna.Native.loadLibrary(Native.java:374)

at com.sun.jna.Native.loadLibrary(Native.java:359)

at Main1$Clibrary.(Main1.java:9)

at Main1.main(Main1.java:19)

2个回答

请问 库:libopencv_java2413.so,是你自己编的还是从网上下载的?我需要一个这样的库,不知道怎么获取?大侠,看见帮忙回答一下,十分感谢!!!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问