Unsatisfied Link Error despite Shared Library existing at proper location

Hello! I’ve been working on a codebase for a while now on Ubuntu 20.04, but for a ROS dependency I’ve installed 18.04 on another partition and am trying to get going again. In the new installation, I’ve recompiled my copy of OpenHMD, as well as OpenHMD-Java, but am getting the following error preventing program compilation.

The code referencing the shared library is as follows:

public class OpenHMD 
{
	static 
	{
		System.load("/home/john/repos/OpenHMD-Java/libOpenHMD.so");
	}

// code abridged for brevity, but can be found here:
// https://github.com/OpenHMD/OpenHMD-Java/blob/master/OpenHMD.java
}

Going into that directory, I can see the libOpenHMD.so file sitting there.

The error is as follows:

processing.app.SketchException: UnsatisfiedLinkError: /home/john/repos/OpenHMD-Java/libOpenHMD.so: libopenhmd.so.0: cannot open shared object file: No such file or directory
	at processing.mode.java.JavaBuild.placeException(JavaBuild.java:634)
	at processing.mode.java.runner.Runner.findException(Runner.java:814)
	at processing.mode.java.runner.Runner.reportException(Runner.java:789)
	at processing.mode.java.runner.Runner.exceptionEvent(Runner.java:709)
	at processing.mode.java.runner.Runner$2.run(Runner.java:599)
UnsatisfiedLinkError: /home/john/repos/OpenHMD-Java/libOpenHMD.so: libopenhmd.so.0: cannot open shared object file: No such file or directory
A library relies on native code that's not available.
Or only works properly when the sketch is run as a 32-bit application.

I’m also seeing that the 64 bit version of Processing is the only one available from Processing.org, and my Ubuntu installation is 64 bit as well.

This is also my first project working with external libraries not curated by Processing, so it’s very possible I’ve overlooked something when trying to set up my environment again.

Thank you so much for any help you can offer.

have you tried linking the full path?

Is that not what I’m already doing in the static line of the class definition?

Not sure, I don’t know that home can be used to replace c:\user\documents

Or wherever your file is located. I might be wrong though.

I’m on a Linux system. There’s no C:/, this is the equivalent direct path.

1 Like

Gotcha,

Can you call import on Linux? On windows I sometimes find myself adding the library to the code folder inside the sketch path, whilst adding an import statement.

Hi,
It looks we tried same stuff… with same results.

Did you solve this openHMD declaration?
Cordialy,
Thierry