ld can't find libraries
Tim Kientzle
tim at kientzle.com
Wed Mar 31 14:56:07 PST 2004
Richard Bradley wrote:
>>
>> I can't get ld to recognise some "so" libraries without using the -L
>> option:
>>
>> %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
ldconfig has nothing to do with ld.
ldconfig is associated with the dynamic linker (ld-elf.so.1),
which locates dynamic libraries at run-time.
ld has a completely separate mechanism for
locating (static or dynamic) libraries at compile-time.
There may be a way to set the defaults
for ld, but I don't happen to know it.
Tim Kientzle
More information about the freebsd-hackers
mailing list