This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unable to link to library version of my choice


On 1 March 2012 20:22, Marco Ricci wrote:
> 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?

Yes, -Lxxx -Wl,-rpath,xxx where xxx is the path to the library.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]