I have a library written in C ++ (actually a Firefox plugin, xyz.dll), and I need to access its methods from Java.
public class AccessLibrary { public interface Kernel32 extends Library { public void showVersion(); } public static void main(String[] args) { Kernel32 lib = (Kernel32) Native.loadLibrary("xyz.dll", Kernel32.class); lib.showVersion(); } }
The following error was received at runtime:
java -jar dist/accessLibrary.jar Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up function 'showVersion': The specified procedure could not be found.
In the source code of the source library, the method is defined as follows
void CPlugin::showVersion() { }
I am very new to Java. Maybe I missed something basic. I looked at similar questions, but none of them solves my problem.
Forgot to mention that I use Windows 7 64bit and Java 7.
source share