*BSD News Article 95344


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!news.maxwell.syr.edu!eerie.fr!alma.fr!oleane!pasteur.fr!jussieu.fr!fdn.fr!r2d2.fdn.org!sphynx.fdn.fr!causse
From: causse@sphynx.fdn.fr (Philippe Causse)
Subject: Re: Help: Shared Libs
X-Newsreader: TIN [version 1.2 PL2]
Organization: individual - paris - france
Message-ID: <EA6IEJ.Ht@sphynx.fdn.fr>
References: <5k5s03$f38$1@nnrp.cs.ubc.ca> <5k7kj8$cv2$2@sol.ctr.columbia.edu> <5l9v55$97l@condor.cns.iit.edu>
Date: Wed, 14 May 1997 16:13:31 GMT
Lines: 29
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:40888

Ed Hovorka (HOVOEDW@minna.cns.iit.edu) wrote:
: In <5k7kj8$cv2$2@sol.ctr.columbia.edu> wpaul@ctr.columbia.edu writes:
[... stuff removed...]
: Can anyone help me?

: I am able to build a shared lib, but when I try to use it I have problems.
: I am able to call dlopen() and it loads successfully.  But, when I call dlsym()
: to load a function, it fails by returning 0, and dlerror() returns a null
: string. (errno is also not being set).  Are there any special command line
: options I need when compiling my main program (the one that dynamically
: loads my .so)?

Did you set your LD_LIBRARY_PATH environment variable ???

: The same code runs fine on other Unix platforms.  I'm running FreeBSD
: 2.2.1-R.  Thanks,

I used it in 2.1.5, 2.1.6 and 2.1.7 with success for dynamically loading
C objects modules. Loading C++ objects is slightly more complicated since
the compiler `mangles' the names... Furthermore, you need to call the global
constructors/destructors yourself if it's a shared object (not a shared lib).

: | Ed Hovorka // hovoedw@harpo.acc.iit.edu // Illinois Institute of Technology
: |                                          Chicago, IL
: | Moving at the speed of life.
-- 
-------------------------------------------------------------------
P. Causse			http://www.fdn.fr/~pcausse
4.4BSD/X11R6/Motif-2.0/C++	mailto:causse@sphynx.fdn.fr (UUCP)