Error while loading shared libraries: libdb_cxx-4.8.so: cannot open shared object file #4103

issue dlio opened this issue on April 28, 2014
  1. dlio commented at 6:19 PM on April 28, 2014: none

    [centos 6.5, current bitcoin version] I seem to have successfully compiled bitcoind, however, when I try to run it, I get the following:

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

    Having followed the directions here, I downloaded and compiled 4.8 source, but I can't seem to get any BerkeleyDB.4.8 folders to be generated in /usr/local. I have, however, located libdb_cxx-4.8.so in db-4.8.30.NC/build_unix/.libs

    If I simply copy or reference this .so file in the correct places, should that resolve the issue? Using 'locate libdb_cxx' I get entries for 'libdb_cxx.so' and 'libdb_cxx-4.7.so' in /usr/lib64, but that's all.

    Should I point bitcoin/src/m4/bitcoin_find_bdb48.m4, line:7, to 'bdbdirlist=/root/berkeley-db/db-4.8.30.NC/build_unix/.libs' ? (the db-4.8.30.NC/build_unix/build/include directory mentioned above does not exist for me).

    Copying libdb_cxx-4.8.so do /usr/lib64 does not seem to resolve the issue.

    My apologies in advance for my limited understanding. I'm still getting up to speed with several layers of abstraction involved here. Thanks in advance. Full post here: https://bitcointalk.org/index.php?topic=588032

    see also #3550

  2. laanwj commented at 5:52 AM on April 29, 2014: member

    The runtime library cannot find the .so file. There are [at least] two ways to specify the dynamic linker search path. The environment variable LD_LIBRARY_PATH (only in that session) as well as (globally) adding the path to `/etc/ld.so.conf'.

    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
    

    In general: If you build BerkeleyDB from scratch, build only the static library (--with-static) not the shared one (--without-shared). It will not need the static library at runtime, which makes the executable more self-contained (this is the same as done for the gitian builds).

    Closing this as it's more of a question than an actual issue.

  3. laanwj closed this on Apr 29, 2014

  4. g8d3 commented at 5:08 AM on January 29, 2017: none

    On ubuntu, installing libdb5.3++ worked for me.

  5. Bitcoin3ra commented at 8:16 PM on February 23, 2018: none

    This worked for me too. Thanks @juanpastas

  6. scottie commented at 4:50 AM on March 30, 2018: none

    sudo add-apt-repository ppa:bitcoin/bitcoin sudo apt-get update sudo apt-get install libdb4.8-dev libdb4.8++-dev

  7. mxicoderspl commented at 2:27 AM on April 8, 2018: none

    i have tried installation libdb4.8 but it throws following msg , any help then please write here

    Package libdb4.8-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

    E: Package 'libdb4.8-dev' has no installation candidate E: Package 'libdb4.8++-dev' has no installation candidate

  8. bibz0r commented at 8:49 PM on April 16, 2018: none

    @scottie I had to do this first:

    sudo apt-get install software-properties-common

    for add-apt-repository to work.

    /e Oh noes, this issue is closed. Didn't see that. :(

  9. gurre commented at 11:48 PM on December 11, 2019: none

    On Debian, after running make install you get this message.

    # Libraries have been installed in:
    #    /usr/local/lib
    #
    # If you ever happen to want to link against installed libraries
    # in a given directory, LIBDIR, you must either use libtool, and
    # specify the full pathname of the library, or use the '-LLIBDIR'
    # flag during linking and do at least one of the following:
    #    - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
    #      during execution
    #    - add LIBDIR to the 'LD_RUN_PATH' environment variable
    #      during linking
    #    - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
    #    - have your system administrator add LIBDIR to '/etc/ld.so.conf'
    # 
    # See any operating system documentation about shared libraries for
    # more information, such as the ld(1) and ld.so(8) manual pages.
    
    # Solving using forth option
    su -
    echo "/usr/local/lib" >> /etc/ld.so.conf.d/bitcoind.conf
    ldconfig
    
  10. laanwj commented at 9:42 AM on December 12, 2019: member

    FWIW: The only recommended way to install bdb 4 (besides a depends build) is to use the ./contrib/install_db4.sh script, as described in doc/build-unix.md and other build-*: this builds a static library that is only used by bitcoind, so there's no need to make global system changes

  11. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me