I am working with a virtual machine (CentOS 5.3) that has very little storage space on the main drive (which includes
/usr/local, etc). Most of the storage space is available on a separate drive that is mounted to
/mnt. Consequently, on this drive I have created a basic installation directory (with subdirectories like
lib, etc) and installed a library there.
[standage@vm142-46 ~]$ ls -lhp /mnt/lib total 33M -rw-r--r-- 1 standage iplant-everyone 21M Dec 21 16:29 libgenometools.a -rwxr-xr-x 1 standage iplant-everyone 13M Dec 21 16:29 libgenometools.so
I then tried to link to that library with code that I had written, but it gave me the following message.
/usr/bin/ld: cannot find -lgenometools
I realized I had not updated
ldconfig with the new installation directory I had created, so I went ahead and added
/etc/ld.so.conf and ran
/sbin/ldconfig. However, when I tried to link my code again I got the same error.
I was eventually able to get the libraries to link by creating symlinks to
[standage@vm142-46 ~]$ sudo ln -s /mnt/lib/libgenometools.a /usr/local/lib64 [standage@vm142-46 ~]$ sudo ln -s /mnt/lib/libgenometools.so /usr/local/lib64
...but this doesn't really solve my original problem, it's just a duct-tape solution. What did I do wrong originally and how can I link to the library I've installed?