On Tue, 2005-03-22 at 21:36 +0100, Lukáš Holčík wrote: > Hi, just one linking question: > > How can I choose one from more library versions (and locations), which > the program will be linked against? > > Example (the names are not relevant, it's just an example): > During compiling vim, I want to choose, whether the ncurses in > /usr/lib > or the ncurses in > /opt/ncurses-5.4 > will be used. There is no ./configure --with-ncurses-prefix=... argument.
Compile-time options don't generally affect runtime unless you're building things statically - all they do is tell the compiler/linker where to find things. If you built with something like --with-ncurses-prefix=/opt/ncurses, it'd be built against that version, but would still be run against libraries in /usr if a suitable version was found there. > Will setting LD_LIBRARY_PATH=/opt/ncurses-5.4:$LD_LIBRARY_PATH do the > job? Yes, LD_LIBRARY_PATH has precedence over everything else, including the default locations of /lib and /usr/lib. You can demonstrate it by doing something like the following: cp /usr/lib/libncurses.so.5 $HOME ldd /usr/bin/vim LD_LIBRARY_PATH=$HOME ldd /usr/bin/vim If you compare the output of the two ldd commands, the second will be using the copy of libncurses.so in your home directory. Simon.
signature.asc
Description: This is a digitally signed message part
-- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page