I'm trying to execute a program but got the error

error while loading shared libraries: libdb_cxx-4.8.so: cannot open shared object file: No such file or directory

Is there a way to find out how to fix it?

Thank you!

  • Where did you get this program? How did you install it? What version of Ubuntu are you using? Feb 1 '18 at 18:57

you may want to try and locate it first

 find ~ / -name *libdb*

ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf

 apt-cache search libdb

 apt-get install libdb5.3++-dev libdb++-dev libdb5.3-dev libdb-dev && ldconfig

LD_LIBRARY_PATH is the predefined environmental variable in Linux/Unix which sets the path which the linker should look in to while linking dynamic libraries/shared libraries.

 export LD_LIBRARY_PATH="/list/of/library/path"

The LD_PRELOAD allow an extra library not specified in the executable to be loaded:

 export LD_PRELOAD="/list/of/library/path"

ldd checks the (so) shared library files for any missing dependencies

 ldd  /usr/lib/x86_64-linux-gnu/libdb-5.3.so

if you're installing it with a package use:

 ./configure --prefix=/usr/local --enable-cxx
  • Thank you, man! Unfortunately I'm too low to add a point for you but u really helped me! Feb 2 '18 at 1:24
  • it's my pleasure, you're welcome
    – Jojo
    Feb 3 '18 at 1:04

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.