To make LD_LIBRARY_PATH stay permanent, You have to add it to /etc/profile (system wide) or ~/.bashrc(for user only).
when you add an entry to /etc/ld.so.conf you *MUST* run /sbin/ldconfig (as root) for it to take permanent effect. ldconfig rebuilds the /etc/ld.so.cache file and the /usr/local/lib files will be searched for by the linker. Generally, LD_LIBRARY_PATH is not the best way to go as it is often misused.
When exporting environment variables, like LD_LIBRARY_PATH the following:
sets LD_LIBRARY_PATH only to usr/local/lib - so if the system had say /opt/whatever/lib in its LD_LIBRARY_PATH that would be gone after the above command.
Instead use LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH - this sets /usr/local/lib as the first directory LD_LIBRARY_PATH searches and doesn't disturb anything that was previously in its path.
alternatively, export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib set /usr/local/lib as the last directory it searches without disturbing the rest of the path.
But, the right way to do it is add /usr/local/lib to /etc/ld.so.conf and run /sbin/ldconfig and that will correct
By the way, if you want to see what ldconfig is finding, run (as root) 'ldconfig -v | more' and you can see exactly what libraries it is finding.
Last edited by __J; 01-01-2005 at 05:15 PM.