Strange dependency on an unlinked shared library

Arun Kumar arun.einstein@gmail.com
Wed Mar 23 11:02:00 GMT 2011


Hello All,
  Thanks to Matt Rice for the LD_DEBUG tip, I found the solution; Ian
and Matt's guess was right; Another library depended on
libavformat.so.51, so this was a problem.

On Tue, Mar 22, 2011 at 8:22 PM, Ian Lance Taylor <iant@google.com> wrote:
> Arun Kumar <arun.einstein@gmail.com> writes:
>
>>   I'm linking an application against some shared libraries, which are
>> compiled locally:
>>
>>         gcc -Wl,--rpath=$ORIGIN/lib -L../../ffmpeg/lib -lavformat
>> -lavutil  my_prgram.o -o my_program
>>
>>   When I do an
>>                  readelf -a my_program
>>
>>    I see that the libraries libavformat.so.52, libavutil.so.49 etc..
>> (basically the libraries in the path `../../ffmpeg/lib') are `NEEDED'
>> and not anything else, but strangely enough
>> when I try to execute -- it has a dependency on another
>> libavformat.so.51 (probably an older version which might have been
>> installed on the system in the past, but not on `NEEDED'
>> list).
>>
>> Also on executing:
>>
>>                ldd
>>
>>    It shows the dependency on the older version of the library is `not
>> found'. I'm baffled, is there a possibility of executable asking for a
>> library it was not linked against?
>
> Sure, if one of the shared libraries on the NEEDED list itself has a
> NEEDED reference.
>
> Ian
>



-- 
Cheers & Regards,
Arun Kumar M S
Systems Engineer,
AVK systems,
IIIT-B campus,
Electronic city,
Bangalore
www.avksystems.com



More information about the Binutils mailing list