Hi JNA-Users,
I just can't get JNA to run under 64bit Windows 7. I created a very simple test project which compiles to a shared library and a JNA project which calls a helloWorld like function. I verrified that it generally works under MacOSX with the exact same source.
I compiled the shared library (DLL) on windows using mingw-w64 with -m64 and it compiles fine. In my test project I used this to make sure that JNA looks in my project working dir:
System.setProperty("jna.library.path",System.getProperty("user.dir"));
System.setProperty("java.library.path",System.getProperty("user.dir"));
System.out.println("JNA library path is: " + System.getProperty("jna.library.path"));
I get the following error while running the Java app with JNA:
JNA library path is: C:\Users\myusername\Documents\NetBeansProjects\JNATest
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libCppDynamicLibraryTest.dll': Das angegebene Modul wurde nicht gefunden.
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:199)
at jnatest.LibCppDynamicLibraryTestLibrary.<clinit>(LibCppDynamicLibraryTestLibrary.java:18)
at jnatest.JNATest.main(JNATest.java:22)
Java Result: 1
I thought my problem is related to https://groups.google.com/forum/#!msg/jna-users/Fq5RTlrco2E/sIil8zd5wWEJ but I do allready use the extern statement:
extern "C" {
void sayNtimesHelloWorld(int n);
}
Please can anyone point me to a possible error I made or a way to debug this?
I've tried hours getting this to work and have no ideas left what to try next.
Thank you very much!
Andreas Piening