Reputation: 169
I have a dll, which I want to use in my java code. I declare a function as native and the return type is bool (c). As I saw in JNI documentation, java 'boolean' should be mapped as 'jboolean' in c code. But the problem is that i don't have the c code, only dll.
My actually problem is UnsatisfiedLinkError, but I have no idea what else can be wrong.
If it is the problem, should i write another c-wrapper?
(I know that this exception was already discussed a lot of times, but I didn't find some useful information according my case)
UPD: Maybe there are anothere way to use dll?
Upvotes: 0
Views: 123
Reputation: 310840
You can't use an arbitrary DLL directly from Java. You have to declare a native Java method, write the JNI for it, and call the DLL method(s) from the JNI code.
Upvotes: 1