I’ve figured out which .so files are needed by my program to work on other machines, but I’m not sure what I need to do with them to make sure that my program will find them and link with them on execution.
I know that on Windows platforms I can just dump the .dll files in the directory of the executable and be done with it. This doesn’t seem to be the case on Linux, though.
$ ls
libjrtp.so.3.9.1 libjthread.so.1.3.1 libQtCore.so.4 libQtGui.so.4 streamer
$ ./streamer
./streamer: error while loading shared libraries: libjrtp.so.3.9.1: cannot open shared object file: No such file or directory
I find it odd that the program can’t link with the library even though it’s basically sitting right there in the working directory. Why isn’t it linking?
It’s probably not linking because
.isn’t in theRPATHof your binary (You can use-Rto set this). Unix systems don’t look in the current directory for needed files like Windows does/used to do. You can confirm this withldd ./binary.