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

3 Answers 3

1

ldd /path/to/file

works for both executables and shared libraries.

1
  • Are you saying I need to apply ldd to each shared library that my executable needs? Hmm, it's a possibility...
    – Arkadiy
    Commented Nov 8, 2010 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.

1
  • I have sources to some components but not to all. I link with g++, using -l and -L switches.
    – Arkadiy
    Commented Nov 8, 2010 at 21:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .