I do not understand. I usually install third-party software in / usr / local, so the libraries are installed in / usr / local / lib and never have problems linking to these libraries. But now this suddenly doesn’t work anymore:
$ 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 a parameter -L/usr/local/lib, how does it work, but I have never had to use this before. Header files in / usr / local / include were found without adding -I/usr/local/include.
I am using Debian GNU / Linux 6 (Squeeze), which by default has an entry for / usr / local / lib in /etc/ld.so.conf.d/libc.conf and the ldconfig cache knows the library I am 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 hell is here? Where can I check which library paths are searched by gcc by default? Maybe something is wrong there.