From: rwp@nmti.com (roland pringle)
Subject: Re: Problem with shared libraries
Date: Mon, 25 Jul 1994 19:07:10 GMT [thread overview]
Message-ID: <id.5MJB1.TYJ@nmti.com> (raw)
In-Reply-To: 1994Jul25.141001.26281@datum.nyo.dec.com
In article <1994Jul25.141001.26281@datum.nyo.dec.com>,
Frank Wortner <frank@nyo.dec.com> wrote:
>
>In article <JOHN.94Jul22131852@avante.WPI.EDU>, john@avante.WPI.EDU (John Stoffel) writes:
>
>|>To modify the search path, you can do:
>|>
>|> setenv LD_LIBRARY_PATH "/path/to/librca.so
>|>
>|>or you can try this when compiling your code:
>|>
>|> ld -rpath "/path/to/librca.so" main.o -o main -L/path/to" -lrca
>|>
>|>I haven't tested this myself, but that's how I read the man page for
>|>loader.
>|>
>
>Just to make the point a little clearer, think of LD_LIBRARY_PATH like PATH,
>the *search path* for the library, not its full pathname.
>
> setenv LD_LIBRARY_PATH /path/to:/some/other/path
>
>This would make the runtime loader search the directories /path/to and
>/some/other/path for libraries before searching the default library
>directories.
>
>"-rpath" also takes a list of directories, not libraries.
>
> ld -rpath /path/to:/some/other/path main.o ...
>
>Also, if you might want to use the cc or f77 or other compiler command
>to do the linking, rather than calling ld directly. That way you can
>be sure that startup routines and other required libraries get integrated
>into the executable. For example,
>
> cc -rpath /path/to:/some/other/path -threads main.o -L/path/to -lrca
>
>If you do want to use ld directly, run the compiler command with the -v
>option first, so you can see what startups and "hidden" libraries you will
>need to explictly use. "-threads" for example, adds "-lpthreads -lmach
>-lc_r" to the link list.
>
>Have fun! 8-)
>
> Frank
My apologies for not providing enough information.
All C code has been compiled with "-g -std1 -shared" compile options.
All Fortran code has been compiled with "-g -c -col72 -cross_reference -K -v -V -std -names as_is -assume nounderscore -shared" compile options.
All shared libraries are build with ld using the -shared option, i.e.,
ld -shared object.list library.name
All linking is done with either cc or f77 using the -call_shared option. I am
using threads and the library search path does include the "-lpthreads -lmach
-lc_r" libraries.
I am using the LD_LIBRARY_PATH environmental variable in the form
/path/to to provide the location of the shared libraries I built.
I get no link errors. Only upon execution of the Fortran program do I get an
error that says it is unable to map libxxx.so. Libxxx.so will vary depending
upon the order of the shared libraries entered on the link command, i.e.,
f77 -called_shared xthreads main.o -L/path/to -lxxx -lyyy -lzzz
Thanks again,
Roland
--
Roland Pringle (rwp@nmti.com)
Network Management Technology, Inc.
1601 Industrial Blvd.
Sugar Land, Texas 77487
+1 713 274-5084
next prev parent reply other threads:[~1994-07-25 19:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-07-22 16:30 Problem with shared libraries roland pringle
1994-07-22 17:18 ` John Stoffel
1994-07-25 14:10 ` Frank Wortner
1994-07-25 19:07 ` roland pringle [this message]
1994-07-27 19:05 ` Frank Wortner
[not found] ` <JOHN.94Jul22131852@avante.wpi.edu>
1994-07-25 15:45 ` roland pringle
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox