From: frank@niagara.nyo.dec.com (Frank Wortner)
Subject: Re: Problem with shared libraries
Date: Mon, 25 Jul 1994 14:10:01 GMT [thread overview]
Message-ID: <1994Jul25.141001.26281@datum.nyo.dec.com> (raw)
In-Reply-To: JOHN.94Jul22131852@avante.WPI.EDU
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
next prev parent reply other threads:[~1994-07-25 14:10 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 [this message]
1994-07-25 19:07 ` roland pringle
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