I have a certain shared object library in a special directory which I
- make sure special directory is in $LD_LIBRARY_PATH
- make sure this directory has read and execute permisions for all
- make sure appropriate library directory is in ld.so.conf and that root has done a ldconfig (verify by checking for library using ldconfig -p as normaluser.
- make sure it is has no soname problems (i.e. create a few symlinks if necessary)
Now, say I compile a program that needs that special library, a program packaged in a typical Open Source manner which ./configure && make, etc) and it says -lspecialibrary cannot be found, an error which a lack of any of the above checks would also probably throw.
A workaround I have done is to symlink the library to /usr/local/lib64 and suddenly the library has ben found. Also when compiling a relatively simple package, I manually add -L/path/to/spec/lib and that also has worked. But I regard those two methods as hacks, so I was looking for any clues as to why my list of checks aren't good enough to find a library.
(I particularly find the $LD_LIBRARY_PATH of shallow use. In fact I can exclude certain libraries from it, and they will still be found in a compilation process).
Thanks in advanced for considering this question. Cheers.