Subject: Use of libraries installed under /usr/pkg/lib...
To: None <>
From: gabriel rosenkoetter <>
List: current-users
Date: 09/19/2001 23:56:56
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:

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/'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and 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?

       ~ g r @

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

Version: GnuPG v1.0.6 (NetBSD)
Comment: For info see