Re: [Fedora-tools-list] how do you link to a different lib location at run time?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 29, 2004 at 10:52:52AM -0500, Robert P. J. Day wrote:
>   if i call the old and new library locations "/old" and "/new"
> respectively, one option is to compile the programs with:
> 
>   $ gcc ... -Wl,-R /new -L/old -llib1 -llib2

Hmm, -Wl,-R /new is wrong.
Either use -Wl,-R,/new or -Wl,-R -Wl,/new or -Wl,-rpath,/new.
The linker certainly doesn't demand the rpath to exist.
If you want to link against say lib1.so that links against lib2.so
in /old, but in the end will be in /new, you can use -rpath-link
too, i.e. gcc ... -Wl,-rpath,/new,-rpath-link,/old -L/old -l1

>   other options include working with /etc/ld.so.conf on the new

/etc/ld.so.conf.d/*.conf works well.

	Jakub


[Index of Archives]     [GCC Help]     [Fedora Development]     [Fedora Announce]     [Fedora Legacy Announce]     [Home]     [Fedora Config]     [PAM]     [Red Hat 9]     [Big List of Linux Books]     [Gimp]     [Yosemite News]

  Powered by Linux