./wallet/bdb.h:27:10: fatal error: db_cxx.h: No such file or directory #25266

issue kristapsk opened this issue on June 2, 2022
  1. kristapsk commented at 1:17 AM on June 2, 2022: contributor

    I'm having build error with current master (1c7ef0abd11f35a27cc860ceb7e075b78f53cecf), with Gentoo Linux:

    $ make clean
    $ ./autogen.sh
    $ ./configure
    $ make
    ...
      CXX      qt/libbitcoinqt_a-rpcconsole.o
    In file included from qt/rpcconsole.cpp:32:
    ./wallet/bdb.h:27:10: fatal error: db_cxx.h: No such file or directory
       27 | #include <db_cxx.h>
          |          ^~~~~~~~~~
    compilation terminated.
    $ locate db_cxx.h
    /usr/include/db4.8/db_cxx.h
    /usr/include/db5.3/db_cxx.h
    

    Reverting 46a890960e4b07e5aec479aa8e07e9c34ce68aee (#25244) fixes the problem.

  2. kristapsk added the label Bug on Jun 2, 2022
  3. maflcko added this to the milestone 24.0 on Jun 2, 2022
  4. maflcko added the label Build system on Jun 2, 2022
  5. maflcko commented at 3:31 PM on June 2, 2022: member

    Steps to reproduce on a fresh install of Fedora:

    dnf install gcc-c++ libtool make autoconf automake python3 clang llvm lbzip2 patch xz      curl wget htop git vim ccache  libevent-devel boost-devel qt5-qttools-devel qt5-qtbase-devel   -y && git clone https://github.com/bitcoin/bitcoin.git ./bitcoin-core && cd bitcoin-core && ./contrib/install_db4.sh $PWD && export BDB_PREFIX='/bitcoin-core/db4' && ./autogen.sh && ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" CC=clang CXX=clang++ && make -j $(nproc)
    
  6. laanwj commented at 3:38 PM on June 2, 2022: member

    Interesting, I wonder why it includes that (and why we didn't notice before),

    In file included from qt/rpcconsole.cpp:32:
    ./wallet/bdb.h:27:10: fatal error: db_cxx.h: No such file or directory
    
  7. maflcko added the label Wallet on Jun 2, 2022
  8. laanwj commented at 4:19 PM on June 2, 2022: member

    It looks like these wallet includes are completely unnecessary

    bitcoin-core/gui#613 should fix this

  9. hebasto closed this on Jun 2, 2022

  10. sidhujag referenced this in commit f0e87778dc on Jun 3, 2022
  11. HaltCatchF1re commented at 4:21 AM on July 19, 2022: none

    This error is still persists for me. Is there a version or branch I can compile that this issue does not appear?

    root@reserve1:~/code/bitcoin# make
    Making all in src
    make[1]: Entering directory '/root/code/bitcoin/src'
    make[2]: Entering directory '/root/code/bitcoin/src'
    make[3]: Entering directory '/root/code/bitcoin'
    make[3]: Leaving directory '/root/code/bitcoin'
      CXX      wallet/libbitcoin_node_a-init.o
    In file included from wallet/init.cpp:20:
    ./wallet/bdb.h:27:10: fatal error: db_cxx.h: No such file or directory
       27 | #include <db_cxx.h>
          |          ^~~~~~~~~~
    compilation terminated.
    make[2]: *** [Makefile:10263: wallet/libbitcoin_node_a-init.o] Error 1
    make[2]: Leaving directory '/root/code/bitcoin/src'
    make[1]: *** [Makefile:18680: all-recursive] Error 1
    make[1]: Leaving directory '/root/code/bitcoin/src'
    make: *** [Makefile:815: all-recursive] Error 1
    root@reserve1:~/code/bitcoin# git branch
    * master
    
  12. hebasto commented at 6:52 AM on July 19, 2022: member

    @HaltCatchF1re

    This error is still persists for me. Is there a version or branch I can compile that this issue does not appear?

    Which version or commit are you compiling?

  13. HaltCatchF1re commented at 4:31 AM on July 22, 2022: none

    @hebasto Originally I tried compiling without specifying a branch. But then I switched to master. Finally I tried version 0.21.1 which the instructions I found were using.

    git branch
    * (HEAD detached at v0.21.1)
      master
    

    Switched to v23.0 and it worked.

  14. da2ce7 commented at 6:59 AM on October 26, 2022: none

    @MarcoFalke @hebasto On Fedora 37, using toolbox, I run into the same sort of error:

    (using the one-liner that MarcoFalke used above).

    $ sudo dnf install gcc-c++ libtool make autoconf automake python3 clang llvm lbzip2 patch xz curl wget htop git vim ccache  libevent-devel boost-devel qt5-qttools-devel qt5-qtbase-devel
    $ git clone https://github.com/bitcoin/bitcoin.git ./bitcoin-core && cd bitcoin-core && ./contrib/install_db4.sh $PWD && export BDB_PREFIX='/bitcoin-core/db4' && ./autogen.sh && ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" CC=clang CXX=clang++ && make -j $(nproc)
    
    In file included from wallet/bdb.cpp:8:
    ./wallet/bdb.h:27:10: fatal error: 'db_cxx.h' file not found
    #include <db_cxx.h>
             ^~~~~~~~~~
      CXX      libbitcoin_common_a-deploymentinfo.o
    1 error generated.
    make[2]: *** [Makefile:11519: wallet/libbitcoin_wallet_a-bdb.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    In file included from wallet/walletdb.cpp:18:
    ./wallet/bdb.h:27:10: fatal error: 'db_cxx.h' file not found
    #include <db_cxx.h>
             ^~~~~~~~~~
    In file included from wallet/salvage.cpp:9:
    ./wallet/bdb.h:27:10: fatal error: 'db_cxx.h' file not found
    #include <db_cxx.h>
             ^~~~~~~~~~
    1 error generated.
    make[2]: *** [Makefile:11463: wallet/libbitcoin_wallet_a-walletdb.o] Error 1
    1 error generated.
    
  15. maflcko commented at 7:10 AM on October 26, 2022: member

    @da2ce7 You are passing the wrong folder to configure. In any case, bdb is not required, unless you want to load a legacy wallet. Using sqlite is recommended for new wallets.

  16. da2ce7 commented at 7:25 AM on October 26, 2022: none

    @MarcoFalke this is curious, why would the make step fail if bdb is successfully being detected by the configure script? If the wrong folder is given, shouldn't this fail when configuring...

  17. maflcko commented at 7:31 AM on October 26, 2022: member

    Well, then it looks like an unrelated issue to the thread here.

  18. bitcoin locked this on Oct 26, 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-21 15:13 UTC

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