Q: I’m trying to run one of the files located in the bin folder but it gives me this message:
./BaseDemo: error while loading shared libraries: libopenjaus-core.so: cannot open shared object file: No such file or directory
However, I can clearly see libopenjaus-core.so in the lib folder. Am I missing something? Or am I doing something wrong?
A: The issue is that you need to tell Linux where to find the library files for OpenJAUS. There’s a couple ways you can do this:
1. Some version of linux will let you copy the .so files into the bin directory and will do a side-by-side load similar to how Windows does it.
2. You can copy the files into the /usr/lib directory (“install them”) and run the ldconfig command to update your cache
3. You can run ldconfig with the “-n” option and provide the full path to the org.openjaus.sdk.cpp/lib directory and it will add it to the path.
4. You can make a conf file in the /etc/ld.so.conf.d/ folder with the path and it will be loaded automatically on boot-up
There’s a great reference on shared libraries in linux here: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html