Shared library in /usr/local/lib not found

I don't get it. I usually install third party software into /usr/local so libraries are installed into /usr/local/lib and never had problems linking to these libraries. But now it suddenly no longer works:

$ gcc -lkaytils -o test test.c
/usr/bin/ld.gold.real: error: cannot find -lkaytils
/usr/bin/ld.gold.real: /tmp/ccXwCkYk.o: in function main:test.c(.text+0x15):
error: undefined reference to 'strCreate'
collect2: ld returned 1 exit status

When I add the parameter -L/usr/local/lib than it works but I never had to use this before. Header files in /usr/local/include are found without adding -I/usr/local/include.

I'm using Debian GNU/Linux 6 (Squeeze) which has an entry for /usr/local/lib in /etc/ld.so.conf.d/libc.conf by default and the ldconfig cache knows the library I'm trying to use:

k@vincent:~$ ldconfig -p | grep kaytils
        libkaytils.so.0 (libc6,x86-64) => /usr/local/lib/libkaytils.so.0
        libkaytils.so (libc6,x86-64) => /usr/local/lib/libkaytils.so

So what the heck is going on here? Where can I check which library paths are searched by gcc by default? Maybe something is wrong there.

6
задан kayahr 3 May 2011 в 17:48
поделиться