I have my own executable that I link to a particular version of Xerces. It also uses a bunch of other libraries, some of them not my own. When I run ldd on that executable, I see that it needs the Xerces version that I expect it to need, plus another version. I assume the other version comes from one othe other libraries I link to.

Here is the question: how do I find out which third-party library requires the older Xerces?

The environment is Linux and Solaris (my executable is compiled for both).

link|improve this question
feedback

3 Answers

up vote 1 down vote accepted

ldd /path/to/file

works for both executables and shared libraries.

link|improve this answer
Are you saying I need to apply ldd to each shared library that my executable needs? Hmm, it's a possibility... – Arkadiy Nov 8 '10 at 21:55
feedback
ldd <executable> | sed 's/^.*=> //' | sed 's/ (0x.*)$//' | grep mnh_tst1_main | grep -v xerces | xargs ldd 2>/dev/null | egrep "^/|xerces" | grep -B 1 xerces | less

This is what worked for me in the end. Thanks for kicking me off - I was "stuck on stupid".

link|improve this answer
feedback

Without more information on how you are linking this executable (do you have the source code or not?) it's not very easy to understand the question. I would suggest running ldd on each of the libraries your executable links to.

link|improve this answer
I have sources to some components but not to all. I link with g++, using -l and -L switches. – Arkadiy Nov 8 '10 at 21:56
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.