I'm trying to build the JShortcut dll for x64 based the source found in Github : https://github.com/jimmc/jshortcut/
I cloned the repository, followed the Make instructions. But I have trouble with following action:
You can build everything except for the DLL on any machine with Java and GNU make. You can build the DLL separately on a Windows machine by running the compile.bat script in the src/jni directory. Do this just after doing the "make all" in the sequence below.
This file is :
cl "-IC:/Program Files/Java/jdk1.8.0_162/include" "-IC:/Program Files/Java/jdk1.8.0_162/include/win32" -LD jshortcut.cpp -Fejshortcut_amd64.dll Advapi32.lib shell32.lib ole32.lib
And cl
is not recognized. I don't know what to do. I'm using Apache Netbeans 12 with cpp support. So I guess I should be able to do this from Netbeans, but I'm not familiar at all with cpp.
[Edit]
I replaced :
cl
bygcc
(after FoggyDay suggestion) and- all the
.lib
by their.dll
counterpart ,
I've got now:
gcc "-IC:/Program Files/Java/jdk1.8.0_162/include" "-IC:/Program Files/Java/jdk1.8.0_162/include/win32" -LD jshortcut.cpp -Fejshortcut_amd64.dll /cygdrive/c/Windows/System32/Advapi32.dll /cygdrive/c/Windows/System32/shell32.dll /cygdrive/c/Windows/System32/ole32.dll
The compilation gives me the following error:
gdrive/z/Temp/ccdePcoW.o:jshortcut.cpp:(.xdata$_ZN7JNIEnv_9NewObjectEP7_jclassP10_jmethodIDz+0xc): undefined reference to `__gxx_personality_seh0'
gdrive/z/Temp/ccdePcoW.o:jshortcut.cpp:(.xdata$_ZN7JNIEnv_9NewObjectEP7_jclassP10_jmethodIDz+0xc): relocation truncated to fit: rva32 against undefined symbo
__gxx_personality_seh0'
r/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: /cygdrive/z/Temp/ccdePcoW.o: bad reloc address 0x0 in section `.pdata$_ZN7JNIEnv_9NewOb
tEP7_jclassP10_jmethodIDz'
lect2: error: ld returned 1 exit status
There is a similar error in this post, but I have not enough knowledge to apply this here. The jshortcut.cpp file can be found on GitHub.