ld can't find libraries
Richard Bradley
rtb27 at cam.ac.uk
Wed Mar 31 14:12:26 PST 2004
Hi all,
I can't get ld to recognise some "so" libraries without using the -L option:
%cat test.c
int main () {}
%ls /usr/local/lib/libsqlite*
/usr/local/lib/libsqlite.a /usr/local/lib/libsqlite.so.2
/usr/local/lib/libsqlite.so
%gcc test.c -lsqlite
/usr/bin/ld: cannot find -lsqlite
%gcc test.c -L/usr/local/lib -lsqlite
%
However, /usr/local/lib is in its search path:
%ldconfig -r | grep sql
search
directories: /usr/lib:/usr/lib/compat:/usr/X11R6/lib:/usr/local/lib:/usr/local/lib/compat:/usr/local/lib/mysql:/usr/local/lib/compat/pkg:/usr/local/lib/wine:/usr/local/lib/kde3
504:-lsqlite.2 => /usr/local/lib/libsqlite.so.2
517:-lmysqlclient_r.12 => /usr/local/lib/mysql/libmysqlclient_r.so.12
518:-lmysqlclient.12 => /usr/local/lib/mysql/libmysqlclient.so.12
%
What is going on here?
Any help would be much appreciated,
Rich
More information about the freebsd-hackers
mailing list