From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,cd922e43161a3f1d X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-07-25 07:54:04 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!agate!darkstar.UCSC.EDU!news.hal.COM!olivea!decwrl!pa.dec.com!datum.nyo.dec.com!niagara.nyo.dec.com!frank From: frank@niagara.nyo.dec.com (Frank Wortner) Subject: Re: Problem with shared libraries Message-ID: <1994Jul25.141001.26281@datum.nyo.dec.com> Sender: usenet@datum.nyo.dec.com (USENET News System) Reply-To: frank@nyo.dec.com Organization: Digital Equipment Corporation X-Newsreader: mxrn 6.18-16 References: Date: Mon, 25 Jul 1994 14:10:01 GMT In article , 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