我正在尝试在 Netbeans 7.0.1 中加载 DLL 文件,
代码是
dll = (RRHFEK02DLL)Native.loadLibrary("RRHFEK02DLL.dll", RRHFEK02DLL.class);
utility = (Utilities)Native.loadLibrary("Utilities.dll",Utilities.class);
wraper =(RRHFEK02Wrapper)Native.loadLibrary("RRHFEK02Wrapper.dll", RRHFEK02Wrapper.class);
第一行没有错误,这行在提供者的演示中,现在我想加载另外两个 dll,我已经添加了接下来的两行并在库中添加了 dll 文件,但是我得到了错误
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError:
Unable to load library 'Utilities.dll': The specified module could not
be found.
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:166)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:239)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:393)
at com.sun.jna.Native.loadLibrary(Native.java:378)
at rrhfek02.RRHFEK02View.<init>(RRHFEK02View.java:87)
at rrhfek02.RRHFEK02App.startup(RRHFEK02App.java:19)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
我已经解决了相同/相关的问题,但没有得到解决方案。所以,如果有人有,请给我建议。