Re: Compiling a dll for 64-bits W7 with cygwin and mingw-w64
Fran=E7ois Rappaz wrote:
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
Is the path valid? What is the result of
ls $(cygpath 'U:\docs\OA\articles\zlib\kbhook\kbhook.dll')
?
How is the path to the DLL specified in your code?
Why do you not use forward slashes?
--
Lew