On Arch Linux I recently had a similar issue with installing libraries from custom builds. In my case it installed the libraries to /usr/local/lib. Running an application which needed this library resulted in a similar runtime error: can't locate the library. (Wouldn't life be easier on a BSD System? :-D )
The proper solution is to add the new local library directory into the runtime linker path. On Arch Linux, this seems to be:
/etc/ld.so.conf
So to add your new library path,
sudo vi /etc/ld.so.conf
then append the path on a new line:
/usr/local/mysql/lib/
In my case, my /etc/ld.conf.so file now looks like the below, because I added /usr/local/lib:
#
# /etc/ld.so.conf
#
include /etc/ld.so.conf.d/*.conf
/usr/local/lib
# End of file
Verify this is correct my using:
sudo ldconfig -v
Your custom libraries should be listed, i.e. they are "found" by the linker.
To get more info on this configuration file and the runtime linker,
man ldconfig
It seems Arch Linux is set up to use a custom directory with multiple config files (/etc/ld.so.conf.d/*.conf) however that's too much SYSV for me and is complete overkill; just add the new paths to /etc/ld.so.conf.
Placing a symlink in
– SirTasty Aug 14 '11 at 07:42usr/local/lib
(instead of/usr/lib
like I did) would be good. I was just wondering why this was something the user has to do; that's something that could be automated fairly easily. Perhaps it's an oversight?