Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Dec 2004 02:13:18 -0500
From:      "Don L. Belcher" <don@siad.net>
To:        freebsd-stable <freebsd-stable@FreeBSD.ORG>
Subject:   [Fwd: Cannot find libraries in /usr/local/lib even though they are in hints files]
Message-ID:  <41C1358E.1020305@siad.net>

next in thread | raw e-mail | index | archive | help
FreeBSD satellite.siad.net 4.10-STABLE FreeBSD 4.10-STABLE #0: Mon Jul

19 00:39:31 PDT 2004

Cannot find libraries in /usr/local/lib even thought they are in the 
hints file. Is there something else I need to do?
satellite% ld -o hello -lmpeg hello.o
/usr/libexec/elf/ld: cannot find -lmpeg

satellite% ldconfig -r | grep mpeg
       464:-lmpeg.1 => /usr/local/lib/libmpeg.so.1


satellite% ldconfig -r | more
/var/run/ld-elf.so.hints:
       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/pth:/usr/local/lib/wine:/usr/local/lib/kde3


satellite% ll /usr/local/lib/libmpeg.a
-r--r--r--  1 root  wheel  132902 Apr 11  2001 /usr/local/lib/libmpeg.a

Using a library in /usr/lib works:
satellite% ld -o hello -lpam hello.o
/usr/libexec/elf/ld: warning: cannot find entry symbol _start; 
defaulting to 080481c0
hello.o: In function `main':
hello.o(.text+0x25): undefined reference to `puts'

It also works if I manually add the library path
satellite% ld -o hello -lmpeg -L/usr/local/lib hello.o
/usr/libexec/elf/ld: warning: cannot find entry symbol _start; 
defaulting to 080481c8
hello.o: In function `main':







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41C1358E.1020305>