1

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

1

ldd /path/to/file

works for both executables and shared libraries.

  • 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
1
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".

0

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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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