0

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 by gcc (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.

lvr123
  • 524
  • 6
  • 24
  • "cl" is the Microsoft Visual C++ compiler. Try changing your makefile to "gcc" or "g++", if you're using Gnu C/C++ – FoggyDay Mar 01 '20 at 22:09
  • Thanks. I've moved one step further. Having some compilation issues now. – lvr123 Mar 01 '20 at 22:44
  • This means you *must* compile with `g++`. Look here: https://stackoverflow.com/a/203550/3135317 – FoggyDay Mar 02 '20 at 03:10
  • Does this answer your question? [Undefined Symbol \_\_\_gxx\_personality\_v0 on link](https://stackoverflow.com/questions/203548/undefined-symbol-gxx-personality-v0-on-link) – FoggyDay Mar 02 '20 at 16:39

0 Answers0