Download JNI with undefined characters

I try to link my own library with a java application, but when I try to start it, I get a java.lang.UnsatisfiedLinkError exception complaining about missing characters ( _ZTVN10__cxxabiv117__class_type_infoE )

I compiled a shared library with g ++, like any other shared library.

This is my first attempt with JNI, and I cannot figure out how to connect everything correctly.

+4
source share
2 answers

Try returning without the -Wl,-soname,liblzw_compressor.so . If this works, I can’t tell you why, besides those months ago, I had a very similar undefined character error (maybe it was even the same character) and the dropping of the -Wl option from my link line was fixed.

+2
source

You can use the c++filt that comes with your c++filt to demonstrate the missing characters. Then you need to figure out which part of your code does not do what it should do.

nm can be used to display the characters defined in the code. if you see that the character has U in the same line, it is undefined and may lead to this error. passing -E to gcc / g ++ stops the compiler after the preprocessing step, which may also be useful.

The reasons that I had for this error in the past are essentially:

  • without creating something that I thought I was building (this happens to the best of us)
  • Invoking an agreement that manages a symbol in an unexpected way
+4
source

All Articles