Subject: Re: getting "readline" to link
To: Mike Cheponis <mac@Wireless.Com>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 07/21/2005 17:02:24
On Thu, 21 Jul 2005, Mike Cheponis wrote:

> int main(){
>  char *s;
>  s=readline(NULL);
>  return 0;
> }
>
> $ cc program.c -o tp -Wl,--rpath -Wl,LIBDIR

This should be ${LIBDIR} if you want to use that variable.

> /var/tmp//ccWVXCUa.o(.text+0x16): In function `main':
> : undefined reference to `readline'
>
> $ echo $LIBDIR
> /usr/pkg/lib

You need something like:

cc -lcurses -L/usr/pkg/lib -lreadline program.c -o tp  -Wl,--rpath -Wl,/usr/pkg/lib

Have fun!

  Jeremy C. Reed

  	  	 	 BSD News, BSD tutorials, BSD links
 	  	 	 http://www.bsdnewsletter.com/