This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
linking with -Wl,-rpath and $(prefix)
- From: "David Carter-Hitchin" <david at carter-hitchin dot clara dot co dot uk>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 2 Dec 2005 23:47:28 -0000
- Subject: linking with -Wl,-rpath and $(prefix)
Hi,
Someone recently mentioned on this group a method to affect linking. It
was:
-Wl,-rpath,$(prefix)/lib
I've seen some information about this in the FAQ but perhaps it's late in
the day or something but I really don't fully understand what is achieved
here and how. If I read the FAQ correctly one would pass this into GCC when
compiling one's code so that the resultant user binary resolves its
dependencies in the normal way but with the extra help of the directories
specified by -rpath. Is that correct? If so does $(prefix) equal the prefix
set when GCC itself was compiled with ./configure --prefix=<dir> ?
Or perhaps this -Wl option is passed into GCC itself when it is compiled?
Is there a page with a fuller explanation of how GCC linking works?
Thanks,
David.