Subject: Use of libraries installed under /usr/pkg/lib...
To: None <current-users@netbsd.org>
From: gabriel rosenkoetter <gr@eclipsed.net>
List: current-users
Date: 09/19/2001 23:56:56
--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I'm sure this is some boneheaded mistake, but I can't seem to figure
out how to link against stuff that's been installed by a package. In
particular, I'm trying to use readline. I've read the notes that
pkgsrc spits out at the end of any library install:

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/pkg/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

So, I'm doing, as near as I can tell, what that calls for, but I'm
getting no love:

grappa:cs45/tish% cc -L/usr/pkg/lib -Wl,--rpath -Wl,/usr/pkg/lib -o split_t=
est split_test.c tish_split.c=20
/tmp/ccRYTMxL.o: In function `main':
/tmp/ccRYTMxL.o(.text+0xe): undefined reference to `readline'
collect2: ld returned 1 exit status

What's my silly error here?

--=20
       ~ g r @ eclipsed.net

--PEIAKu/WMn1b1Hv9
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (NetBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE7qWkH9ehacAz5CRoRAl5SAJ0WBRWHjnqhuP9VICxnK4OiWI2oQwCeIfEg
eH47Gt/RGxuKBUhlcCFc0eM=
=FgVd
-----END PGP SIGNATURE-----

--PEIAKu/WMn1b1Hv9--