Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 1996 18:54:40 +0100
From:      "Gary Palmer" <gpalmer@FreeBSD.ORG>
To:        Chuck Robey <chuckr@Glue.umd.edu>
Cc:        FreeBSD Ports <FreeBSD-Ports@FreeBSD.ORG>
Subject:   Re: dynamic linking 
Message-ID:  <14528.832010080@palmer.demon.co.uk>
In-Reply-To: Your message of "Mon, 13 May 1996 00:50:13 EDT." <Pine.OSF.3.91.960513004455.7203B-100000@thurston.eng.umd.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
Chuck Robey wrote in message ID
<Pine.OSF.3.91.960513004455.7203B-100000@thurston.eng.umd.edu>:
> One more time, in case you missed it.  If I don't get an answer this 
> time, I'll stop bugging you.  I am working on getting the tcl code to 
> dynamically load modules, and to do that I'm trying to understand the 
> dlopen/dlsym calls.  I wrote a very simple program to test it, which just 
> takes a file from the command line and dloads it.  To use a file I knew 
> was in correct format, I used one from libc, but I always get this kind 
> of error:
> 
> ./dltests /usr/obj/lib/libc/rmdir.so
> testing file /usr/obj/lib/libc/rmdir.so ... dlopen call returned pointer 
> value 0
> dlerror call returns mmap failed for "/usr/obj/lib/libc/rmdir.so" : 
> Invalid argument
> 
> OK, below is the code I wrote to test it.  Anyone got any idea why it's 
> failing?

My first guess would be that you aren't using a linked shared library,
but rather the component of one. Try using dlopen() on something like
/usr/lib/libncurses.so.2.0 and see if that works (after checking that
I got the filename right :-) ) I have an example program here which
(worst case) dlopen()s about, umm, 7 or 8 libraries before it does
ANYTHING else, so I know that it works :-)

Gary
--
Gary Palmer                                            FreeBSD Core Team Member
FreeBSD - Turning PC's into workstations. See http://www.FreeBSD.ORG/ for info.



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