Linux Libraries
The program responsible to load the library and link it to the dependent program is the ld.so, that is invoked by a program every time it needs a function located in an external library.
ld.so can locate a library in question with the help of a mapping located in the file /etc/ld.so.cache. The default location of those system libraries are: /lib and /usr/lib
Directories containing additional libraries should be included in the /etc/ld.so.conf file
In some Linux distributions the directory /etc/ld.so.conf.d/ is also used (ubuntu uses it) and this directory can include some other files pointing other locations to external libraries.
The execution of ldconfig command is fundamental to update the /etc/ld.so.cache everytime a change is made in /etc/ld.so.conf file.
You can use an another method to make the library available to ld.so, and it's using the variable LD_LIBRARY_PATH using the command: export LD_LIBRARY_PATH=path to the library. This method, however makes it temporary access for ld.so to the directory in question, that is because it won't work outside the ambient you're working and it's going to be lost if you boot your system. You can make it permanent editing and adding the directory containing the library in /etc/ld.so.conf and don't forget to run the ldconfig after you changed that.
Hope it helps someone outthere! feel free to contact me in case of any doubts.
I'll post soon an article about ldd command to complement this one. Cya













