Reputation: 21409
I'm getting the following error when trying to interface with a Magtek 32-bit DLL.
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Unable to load library 'MCPAPI': The specified module could not be found.
I have no problem interfacing with user32.dll in the same code (just tweaking the DLL name and interface). Seems to indicate that the DLL can't be found, but it's most definitely in my jna.library.path. I've even gone as far as dumping it into the Windows system directory, next to user32, without success.
What am I missing here?
Upvotes: 1
Views: 1311
Reputation: 10069
jna.library.path will only influence loading of libraries directly referenced. Dependent libraries must be found either in the same directory as the explicitly loaded one, or in PATH.
For your example to work, MCPAPI must be in either jna.library.path or PATH, and its dependent libraries must be either in the same directory or in PATH.
Upvotes: 1
Reputation: 882
try using System.load(path\to\library) instead System.loadLibrary().
Upvotes: 0
Reputation: 4517
If you run a 64bit jvm you cannot load 32bit dll's. If thats the case, install 32bit jvm
Upvotes: 0