Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
up vote 1 down vote accepted

ldd /path/to/file

works for both executables and shared libraries.

share|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
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".

share|improve this answer

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.

share|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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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