我尝试通过此代码加载 SFmpq.dll
static {
Native.setProtected(true);
System.setProperty("jna.library.path",
new File("lib").getAbsolutePath());
System.out.println(System.getProperty("jna.library.path"));
INSTANCE = (SFmpq) Native.loadLibrary("SFmpq", SFmpq.class);
}
它被执行,文件夹和文件存在,但我仍然收到此错误:
C:\Users\Frotty\Documents\NetBeansProjects\Optimizer\lib Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Unable to load library 'SFmpq': The specified module could not be found.
我把代码和 .dll 给了我的一个 friend ,他将它导入到 Eclipse 中,在那里它工作得非常好。 谁能发现我的错误或者如何正确导入 .dll?
最佳答案
如果您尝试在 64 位系统上加载 32 位库,可能会出现此错误。
关于java - LoadLibrary 在 NetBeans 中找不到 .dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6821163/