27

I have program that depends on library that is linked to libboost 1.67, which installed in the system. When I launch it, I have an error that libboost_system.so.1.58 does not exist. LD_PRELOAD and LD_LIBRARY_PATH are unset.

lddtree execution doesn't show this library as dependency but ldd does.

How can I trace from where the library is required?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Alex
  • 381
  • 1
  • 3
  • 5

2 Answers2

32

If on a GNU system, try running your application with:

LD_DEBUG=libs your-application

See LD_DEBUG=help for more options or man ld.so.

7

If the program is loading libboost_system manually using dlopen(), you might be able to find where it is doing that using ltrace to see if it is calling dlopen(), and maybe gdb to set a breakpoint on calls to dlopen() and then generating a stack backtrace. (See also latrace.)

D.W.
  • 4,070