Your library is a dynamic library. You need to tell the operating system where it can locate it at runtime.
To do so, we will need to do those easy steps:
Find where the library is placed if you don't know it.
sudo find / -name the_name_of_the_file.soCheck for the existence of the dynamic library path environment variable(
LD_LIBRARY_PATH)echo $LD_LIBRARY_PATHIf there is nothing to be displayed, add a default path value (or not if you wish to)
LD_LIBRARY_PATH=/usr/local/libWe add the desired path, export it and try the application.
Note that the path should be the directory where the
path.so.somethingis. So ifpath.so.somethingis in/my_library/path.so.something, it should be:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my_library/
Reference to source
Answer from XOR on Stack OverflowYour library is a dynamic library. You need to tell the operating system where it can locate it at runtime.
To do so, we will need to do those easy steps:
Find where the library is placed if you don't know it.
sudo find / -name the_name_of_the_file.soCheck for the existence of the dynamic library path environment variable(
LD_LIBRARY_PATH)echo $LD_LIBRARY_PATHIf there is nothing to be displayed, add a default path value (or not if you wish to)
LD_LIBRARY_PATH=/usr/local/libWe add the desired path, export it and try the application.
Note that the path should be the directory where the
path.so.somethingis. So ifpath.so.somethingis in/my_library/path.so.something, it should be:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my_library/
Reference to source
Here are a few solutions you can try:
ldconfig
As AbiusX pointed out: If you have just now installed the library, you may simply need to run ldconfig.
sudo ldconfig
ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib).
Usually your package manager will take care of this when you install a new library, but not always, and it won't hurt to run ldconfig even if that is not your issue.
Dev package or wrong version
If that doesn't work, I would also check out Paul's suggestion and look for a "-dev" version of the library. Many libraries are split into dev and non-dev packages. You can use this command to look for it:
apt-cache search <libraryname>
This can also help if you simply have the wrong version of the library installed. Some libraries are published in different versions simultaneously, for example, Python.
Library location
If you are sure that the right package is installed, and ldconfig didn't find it, it may just be in a nonstandard directory. By default, ldconfig looks in /lib, /usr/lib, and directories listed in /etc/ld.so.conf and $LD_LIBRARY_PATH. If your library is somewhere else, you can either add the directory on its own line in /etc/ld.so.conf, append the library's path to $LD_LIBRARY_PATH, or move the library into /usr/lib. Then run ldconfig.
To find out where the library is, try this:
sudo find / -iname *libraryname*.so*
(Replace libraryname with the name of your library)
If you go the $LD_LIBRARY_PATH route, you'll want to put that into your ~/.bashrc file so it will run every time you log in:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/library
From ldd, it is clear that prime is a 32bit/i386 build. It requires dependencies from same architecture. We may confirm too using:
file ./prime
We search for each missing library file using apt-file (if installed, be aware it downloads large indexes) or https://packages.ubuntu.com for corresponding package then install it.
sudo apt install libsigsegv2:i386 \
libsdl1.2debian:i386 libsdl-image1.2:i386 liblua5.1-0:i386 \
libsdl-mixer1.2:i386 libsdl-net1.2:i386
For a so called 64-bit application prime needs a bunch i386 libaries. sudo dpkg --add-architecture i386 afterwards sudo apt update
Make sure the not founding libaries are installed for 64-bit and 32-bit.
You can found the relevant packages with apt-file search missing file.
maybe you have to install it sudo apt install apt-file and sudo apt-file update

How to use apt-file
cannot open shared object file: No such file or directory
[Solved] libCore.so: cannot open shared object file: No such
Cannot open shared object file: No such file or directory... part 2
error while loading shared libraries: libjxl.so.0.7: cannot open shared object file: No such file or directory
Videos
Getting this error when trying to open both nextcloud and mpv:
error while loading shared libraries: libjxl.so.0.7: cannot open shared object file: No such file or directory
and there is no libjxl.so.0.7 in my library files, but I do have libjxl.so.0.8 (and libjxl.so.0.8.1). Any idea how to resolve this error?
I am trying to compile this example code from SDL's own github.
My "makefile" (actually just a bash file) looks like this: gcc -O -Wall -W -pedantic --std=c17 -o game main.c -lSDL3 -lm
It compiles fine, so I guess my installation of SDL3 was successful. The CMake script put it in /usr/local/ instead of just /usr/ where apt put SDL2.
libSDL3.so.0 is in here:
/usr/local/lib$ ls -a . cmake libSDL3.so.0 libSDL3_test.a python3.10 .. libSDL3.so libSDL3.so.0.1.3 pkgconfig
The weird thing though is that libSDL3.so is a link to libSDL.so.0, which in turn is a link to libSDL.so.0.1.3 which are all in the same folder... I have no idea what that is good for, but then again, I am a newb.
What should I do? I found a similar problem someone had with SDL2 back in the day, on SO, but I don't really understand that thread.
Thankful for any support!