svn: error while loading shared libraries: libserf-1.so.1: cannot open shared object file: No such file or directory
shared-libraries, svn
Solution
The problem is that by default, the absolute path to any dynamically linked libraries in non-standard locations is not included in the final build. Assuming you are using Linux and gcc, you can either
- fix the problem at compile time by passing additional flags to the linker to store the full path: prefix the configure command above with `LDFLAGS="-Wl,-rpath,$HOME/Downloads/serf_install/lib"./configure...`, or
- fix the problem at runtime by executing `export LD_LIBRARY_PATH="$HOME/Downloads/serf_install/lib:$LD_LIBRARY_PATH"` before each use of svn or by adding it to your `.bashrc` file
The former solution is of course preferred, since it solves the problem at its root instead of providing band-aid.
Problem
I compiled svn 1.8.5 with serf enabled. `./configure --prefix=/home/user/Downloads/svn --with-editor=/home/user/Downloads/vim74-install/bin/vim --with-openssl --with-serf=$HOME/Downloads/serf_install && make && make install ` Then svn complained: `svn: error while loading shared libraries: libserf-1.so.1: cannot open shared object file: No such file or directory ` The `libserf-1.so.1` (and the file it points to) is indeed there `$ll $HOME/Downloads/serf_install/lib/libserf-1.so.1 lrwxrwxrwx 1 user group 18 Feb 22 12:50 /home/user/Downloads/serf_install/lib/libserf-1.so.1 -> libserf-1.so.1.3.0 $ll /home/user/Downloads/serf_install/lib/libserf-1.so.1.3.0 -rwxr-xr-x 1 user group 128441 Feb 22 12:50 /home/user/Downloads/serf_install/lib/libserf-1.so.1.3.0 ` Any idea is appreciated.