F
François Rappaz
With XP I could use the following command to successfully get a dll
for a JNI application, from the Cygwin shell:
g++ -w -mno-cygwin -I"$jdk/include" -I"$jdk/include/win32" -Wl,--add-
stdcall-alias -shared -o kbhook.dll kbhook.cpp
gives a 27 KB kbhook.dll, that works ok.
With Windows 7, I have setup mingw64-x86_64gcc-g++ in my cygwin
framework. When I run the following, from Cygwin:
x86_64-w64-mingw32-g++ -w -mno-cygwin -I"$jdk/include" -I"$jdk/
include/win32" -Wl,--add-stdcall-alias -shared -o kbhook64.dll
kbhook.cpp
I have a kbhook64.dll file which is 118 kB.
However I still have an error when I tried to use it with my java
program.
Exception in thread "main" java.lang.UnsatisfiedLinkError: U:\docs\OA
\articles\z
lib\kbhook\kbhook.dll: The specified path is invalid
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at ch.unifr.dokpe.shortkeys.KbHook.<clinit>(KbHook.java:15)
at ch.unifr.dokpe.shortkeys.KbListener.<init>(KbListener.java:
73)
at ch.unifr.dokpe.shortkeys.KbListener.main(KbListener.java:
317)
Does anybody has a clue on how to correct this ? (beside of using my
old dll with using a 32Bits JRE)
Francois
for a JNI application, from the Cygwin shell:
g++ -w -mno-cygwin -I"$jdk/include" -I"$jdk/include/win32" -Wl,--add-
stdcall-alias -shared -o kbhook.dll kbhook.cpp
gives a 27 KB kbhook.dll, that works ok.
With Windows 7, I have setup mingw64-x86_64gcc-g++ in my cygwin
framework. When I run the following, from Cygwin:
x86_64-w64-mingw32-g++ -w -mno-cygwin -I"$jdk/include" -I"$jdk/
include/win32" -Wl,--add-stdcall-alias -shared -o kbhook64.dll
kbhook.cpp
I have a kbhook64.dll file which is 118 kB.
However I still have an error when I tried to use it with my java
program.
Exception in thread "main" java.lang.UnsatisfiedLinkError: U:\docs\OA
\articles\z
lib\kbhook\kbhook.dll: The specified path is invalid
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at ch.unifr.dokpe.shortkeys.KbHook.<clinit>(KbHook.java:15)
at ch.unifr.dokpe.shortkeys.KbListener.<init>(KbListener.java:
73)
at ch.unifr.dokpe.shortkeys.KbListener.main(KbListener.java:
317)
Does anybody has a clue on how to correct this ? (beside of using my
old dll with using a 32Bits JRE)
Francois