This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld: executable cannot find a versioned shared library
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: alex kabanov <alexander dot kabanov at citi dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 17 Nov 2009 08:03:03 +1030
- Subject: Re: ld: executable cannot find a versioned shared library
- References: <26319759.post@talk.nabble.com>
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