This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Unable to link to library version of my choice
- From: Marco Ricci <marcoricci2012 at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 1 Mar 2012 12:22:15 -0800 (PST)
- Subject: Re: Unable to link to library version of my choice
Thanks to both you and Jonathan Wakely for responding.
> I guess you checked that with ldd on your program, not
> strace on the build?
Correct, but I also had some printf statements and so it was clear at run time as well.
> There are 2 operations called linking. One is when you
> create the binary file. Another one is when you run it. -L
> tells where to look for libraries during the first one.
> -rpath (it is a linker option, so you want -Wl, in front)
> tells where to look during the second one.
So I should use both -L option and -Wl option while compiling?
~~marco