Suppose I have /a/lib/dir
that has files
-rwxrwxr-x libboost_signals.so
-rwxrwxr-x libboost_signals.so.1.55.0
And I create a file: /etc/ld.so.conf.d/testlib.conf
with content
/a/lib/dir
And run
sudo ldconfig
sudo ldconfig -v | head
libboost_signals.so.1.55.0 -> libboost_signals.so.1.55.0
Since ldconfig create a link libboost_signals.so.1.55.0
not libboost_signals.so
,
I can't use -lboost_signals
when use g++ to compile the source code.
But -L/a/lib/dir/ -lboost_signals
is ok.
Edit the .bashrc file as:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/a/lib/dir
then
source .bashrc
will be the same result.
So what is the correct way to add system LD_LIBRARY_PATH?