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?


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.

  • when I try LD_DEBUG=libs python3.6 on tcsh I get LD_DEBUG command not found. What is the tcsh alternative ? – gansub May 6 '19 at 13:11
  • 1
    @gansub prefix the command with env in tcsh – Stéphane Chazelas May 6 '19 at 15:20

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

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.