File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes JNA: The specified procedure could not be found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "JNA: The specified procedure could not be found" Watch "JNA: The specified procedure could not be found" New topic
Author

JNA: The specified procedure could not be found

Nathan Barraille
Greenhorn

Joined: Mar 01, 2011
Posts: 6

Hello,

I was trying to learn how JNA works, so I decided to use the spotify API (libspotify 0.0.7). I managed to load my dll correctly, but then it looks like my code is not finding any of the method defined in the API:



I'm running Windows 7 x86 and I'm running my code in Eclipse.


Here is my code:

Main class


My Library wrapping interface:



Here is the declaration of the method I'm trying to call




The domain classes:




Do you have any idea of what's happening? Do you see any problem with my code?

Thank you!!!

nbarraille
Nathan Barraille
Greenhorn

Joined: Mar 01, 2011
Posts: 6

I finally found the solution by opening the libspotify.dll with Dependency Walker: The compiler added some extra information to the method name (a underscore prefix and a @4 or @8 suffix).

I had to:

- Create an implementation of FunctionMapper that renamed all my methods according to the real names (available in Dependency Walker)
- Instantiate my Library with an instance of this mapper in the options map.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNA: The specified procedure could not be found