NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Where is my shared object?



On Thu, 1 May 2008 16:51:22 +0200 (CEST)
Volker Wolfram <volker%volker-wolfram.de@localhost> wrote:

> 
> Hi all,
> 
> I have a problem as follows:
> 
> My source file:
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <readline/readline.h>
> #include <readline/history.h>
> 
> int
> main (void)
> {
> }
> 
> My Makefile:
> 
> rl:     rl.c
>          cc -o rl -Wall -B/usr/pkg -L/usr/pkg/lib -lreadline rl.c
> 
> The compilation gives no warnings or errors but starting ./rl gives an 
> error:
> 
> Shared object "libreadline.so.5" not found
> 
> This object is in /usr/pkg/lib/.
> 
> Whats wrong?
> 
> Any comments are very welcome.

You are missing -Wl,-R/usr/pkg/lib, otherwise the objs won't be found
at runtime if they are in non-standard location.

-- 
Juan Romero Pardines - xtraeme at gmail|netbsd dot org
        The NetBSD Project

Make your own NetBSD/x86 Live CD
http://www.netbsd.org/~xtraeme/mklivecd/


Home | Main Index | Thread Index | Old Index