openslide / openslide-java

Java bindings to OpenSlide
https://openslide.org/
GNU Lesser General Public License v2.1
41 stars 24 forks source link

Not able to run Demo file #42

Closed sainarendra74 closed 2 years ago

sainarendra74 commented 2 years ago

Installed openslide and followed Building on Linux or Mac OS X instructions. It generated libopenslide-jni.so file and everything seems as expected. But I'm not able to run the demo.java file.

It's giving the following error:

/usr/lib/jvm/java-11-openjdk-amd64/bin/java: symbol lookup error: /usr/local/lib/openslide-java/libopenslide-jni.so: undefined symbol: openslide_get_version

bgilbert commented 2 years ago

Could you post the output of ldd /usr/local/lib/openslide-java/libopenslide-jni.so?

sainarendra74 commented 2 years ago

Thanks for the reply. I created .so file from openslide-jni.c using the following command

gcc openslide-jni.c -shared -o libopenslide-jni.so -lopenslide -I/usr/local/include/openslide -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/

And replaced with the previously generated .so file. It's working.

bgilbert commented 2 years ago

There's not enough info here to debug this, and it sounds like you've found a workaround, so I'll go ahead and close. If you're able to provide the requested information, please feel free to reopen.