This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: ld: executable cannot find a versioned shared library


On Thu, Nov 12, 2009 at 06:35:12AM -0800, alex kabanov wrote:
> Recently, I decided to introduce version numbering to my project. So if the
> version number is 1.2.3 the library linking command now is
> 
> g++ -shared -Wl,-soname,libmylib.so.1 -o libmylib.so.1.2.3 [other options]
> 
> followed by
> 
> ln -sfv libmylib.so.1.2.3 libmylib.so
> 
> creating a convenience symbolic link. this is all still in
> /home/user/project/lib/c++
> 
> running the same executable linking command for the "test" executable as
> above succeeds, but ldd shows that libmylib.so.1 cannot be found by the
> executable.

ln -s libmylib.so.1.2.3 libmylib.so.1

By giving the shared library a soname, you told ld.so to look for that
file.

-- 
Alan Modra
Australia Development Lab, IBM


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