configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality... #7970

issue redfly001 opened this issue on April 29, 2016
  1. redfly001 commented at 7:09 AM on April 29, 2016: none

    I download the Bitcoin code and compile at windows. win7 64bit, using the msys and mingW compile the Bitcoin code. c:/MinGW32 c:/Mingw The msys is in Mingw. Bitcoin code is at h:/vm/bitcoin.sys. Before this, I compiled db-4.8.30.NC(at h:/vm/libs) already, in msys comand line window:

    cd db-4.8.30.NC/build_unix ../dist/configure --enable-mingw --enable-cxx --disable-shared --disable-replication make then I find the db_cxx.h from build_unix folder.

    Compile Bitcoin in the msys command line window:

    cd h: cd vm/bitcoin.sys ./autogen.sh CPPFLAGS="-I/c/deps/boost_1_55_0 \ -I/h/vm/db-4.8.30.NC/build_unix \ ... (autogen other's parameters) ./configure ...(confiture parameters)

    about 20minutes later, the error appeared: configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality(--disable-wallet to disable wallet functionality)

    I try these ways: https://github.com/bitcoin/bitcoin/issues/2998 and https://bitcointalk.org/index.php?topic=588032 The error still over there. Note: in msys, there is no apt-get command, so I cannot do "apt-get install libdb++-dev".

    I found the followings in the config.log file:

    PATH: . PATH: /usr/local/bin PATH: /mingw/bin PATH: /bin PATH: /c/MinGW32/bin ...

    So, I copy the db_cxx.h and related .h file to: c:/mingw/msys/1.0/include/ c:/mingw/msys/1.0/local/include/ c:/mingw/msys/1.0/db48/ c:/mingw/bin/db48/ c:/mingw32/bin/db48/ h:/vm/bitcoin.sys/src/

    There is no effect. I change bdbdirlist in configure file to bdbdirlist="/h/vm/libs/db-4.8.30.NC/build_unix" and change the include in confdefs.cpp to: #include "/h/vm/libs/db-4.8.30.NC/build_unix/db_cxx.h"

    All the work is no effect. How do I?

  2. jonasschnelli added the label Windows on Apr 29, 2016
  3. jonasschnelli commented at 11:30 AM on April 29, 2016: contributor

    Did you pass in the correct include path. You ./configure command could be wrong. I think it should be -I/h/vm/db-4.8.30.NC/build_unix/include/ (append the include/).

    Also, maybe you manage it to install a newer version over a mingw package manager (mingw-get or something), though I'm not familiar with mingw package managers. You can always pass --with-incompatible-bdb in ./configure to allow compilation against newer versions of berkley db (which results in wallet files that are incompatible with bitcoin version compiled with bdb 4.8).

  4. redfly001 commented at 5:16 AM on May 2, 2016: none

    Thanks jonasschnelli ! I sure the db_cxx.h file is in the build_unix folder(ps, there is no sub-dir in the build_unix folder).

    --with-incompatible-bdb option is no useful for this error.

    Another question, sometimes configure shows missing library -lssp or -lcomctl32 or -lwinmm , but not everytime shows the error.

    I think a good idea is understand the configure core grammer or the most important functiones to debug the configure file, but I cannot understand them.

  5. joshafest commented at 1:35 AM on June 10, 2016: none

    You need to build leveldb in local directory

  6. fanquake closed this on Oct 10, 2016

  7. chenluyong commented at 8:20 AM on August 4, 2017: none

    Why close the Issue

  8. sakurashiki commented at 9:44 AM on December 10, 2017: none

    How to resolve this problem???

  9. lukassaul commented at 6:36 AM on January 11, 2018: none

    for me it was helpful to install libboost-all-dev :)

  10. averissimo commented at 8:46 PM on March 2, 2018: none

    this did it for me: export CPPFLAGS="$CPPFLAGS -I/usr/local/BerkeleyDB.4.8/include/

    edit: BerkleyDB.4.8 must be installed in that directory

  11. scottie commented at 7:51 PM on March 10, 2018: none

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

    ;)

  12. bboot commented at 5:50 PM on July 24, 2018: none

    Beware, add-apt-repository ppa:bitcoin/bitcoin has this message: Note that you should prefer to use the official binaries, where possible, to limit trust in Launchpad/the PPA owner.

  13. ccd888 commented at 11:02 AM on January 5, 2019: none

    Scottie's worked for me. Thx!

  14. jasonzhouu commented at 2:07 AM on May 4, 2019: none

    @scottie 's method don't work for me. OS: Debian 9.9

    > sudo add-apt-repository ppa:bitcoin/bitcoin
    gpg: keybox '/tmp/tmpygiedx54/pubring.gpg' created
    gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
    gpg: connecting dirmngr at '/tmp/tmpygiedx54/S.dirmngr' failed: No such file or directory
    gpg: keyserver receive failed: No dirmngr
    

    if build Bitcoin Core without wallet, it will not emit this error

    ./configure --disable-wallet
    

    ref: https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#ubuntu--debian

  15. agbhanu commented at 10:24 AM on May 6, 2020: none

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

    ;)

    Thanks, worked for me Scottie.

  16. r3lik commented at 10:17 PM on October 8, 2020: none

    @scottie 's method don't work for me. OS: Debian 9.9

    > sudo add-apt-repository ppa:bitcoin/bitcoin
    gpg: keybox '/tmp/tmpygiedx54/pubring.gpg' created
    gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
    gpg: connecting dirmngr at '/tmp/tmpygiedx54/S.dirmngr' failed: No such file or directory
    gpg: keyserver receive failed: No dirmngr
    

    if build Bitcoin Core without wallet, it will not emit this error

    ./configure --disable-wallet
    

    ref: https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#ubuntu--debian

    apt-get install dirmngr to fix the gpg issue

  17. rustyx commented at 11:42 AM on December 12, 2020: none

    Just follow the build docs:

    The Bitcoin Core source contains a script contrib/install_db4.sh that downloads and compiles bdb4.8 locally.

    cd bitcoin
    ./contrib/install_db4.sh `pwd`
    

    Then configure bitcoin core with

    ./configure BDB_LIBS="-L`pwd`/db4/lib -ldb_cxx-4.8" BDB_CFLAGS="-I`pwd`/db4/include"  ...
    
  18. Hephaestus14089 commented at 5:19 AM on May 22, 2021: none

    sudo apt update && sudo apt install libdb5.3++ libdb5.3++-dev

  19. visualbasic6 commented at 11:39 PM on November 9, 2021: none

    The solution, at least for Ubuntu 21.10, at the time of writing is:

    wget http://download.oracle.com/berkeley-db/db-4.8.30.zip
    unzip db-4.8.30.zip
    cd db-4.8.30
    cd build_unix/
    ../dist/configure --prefix=/usr/local --enable-cxx
    

    then running sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-4.8.30.NC/dbinc/atomic.h

  20. aelagrassa commented at 4:58 PM on November 27, 2021: none

    The solution, at least for Ubuntu 21.10, at the time of writing is:

    wget http://download.oracle.com/berkeley-db/db-4.8.30.zip
    unzip db-4.8.30.zip
    cd db-4.8.30
    cd build_unix/
    ../dist/configure --prefix=/usr/local --enable-cxx
    

    then running sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-4.8.30.NC/dbinc/atomic.h

    Thanks, this worked for me, also had to run make and make install.

  21. mahyariiii commented at 10:41 PM on January 11, 2022: none

    i have add coin in yiimp
    command line daemonbuilder At the time of installation

    configure: error: libdb_cxx headers missing, Bitcoin ABC requires this library for wallet functionality (--disable-wallet to disable wallet functionality)

    How can I fix this problem, please help me

  22. amritabithi commented at 7:13 PM on January 12, 2022: none

    Run this script to install Berkeley DB: ./contrib/install_db4.sh `pwd`

    Do not run the commands below, they are examples of what you will enter. When you run the above script, at the very end it will output 2 more lines for you to run, that will look like this: export BDB_PREFIX='/home/youruser/Bitcoin/db4' ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...

    REMOVE THE THREE DOTS from the end of the second command, and run both commands in your terminal as your custom ./configure step.

    Now you should be able to build with the wallet features.

  23. DrahtBot locked this on Jan 12, 2023

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 03:15 UTC

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