Skip to content

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

Closed
bitcoin-core/gui
#613

Description

@kristapsk

I'm having build error with current master (1c7ef0a), 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 46a8909 (#25244) fixes the problem.

Activity

  1. added this to the 24.0 milestone on Jun 2, 2022
  2. maflcko commented on Jun 2, 2022

    @maflcko
    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)
    
  3. laanwj commented on Jun 2, 2022

    @laanwj
    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
    
  4. laanwj commented on Jun 2, 2022

    @laanwj
    Member

    It looks like these wallet includes are completely unnecessary

    bitcoin-core/gui#613 should fix this

  5. HaltCatchF1re commented on Jul 19, 2022

    @HaltCatchF1re

    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
    
  6. hebasto commented on Jul 19, 2022

    @hebasto
    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?

  7. HaltCatchF1re commented on Jul 22, 2022

    @HaltCatchF1re

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

  8. da2ce7 commented on Oct 26, 2022

    @da2ce7

    @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.
    
  9. maflcko commented on Oct 26, 2022

    @maflcko
    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.

  10. da2ce7 commented on Oct 26, 2022

    @da2ce7

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

  11. maflcko commented on Oct 26, 2022

    @maflcko
    Member

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

  12. locked and limited conversation to collaborators on Oct 26, 2023
  13. added a commit that references this issue on Sep 10, 2024
    da6792b
  14. added a commit that references this issue on Jun 28, 2026
    df7cc1f
  15. added a commit that references this issue on Jun 30, 2026
    a90561d
  16. added a commit that references this issue on Aug 7, 2026
    a48944e
  17. added a commit that references this issue on Aug 19, 2026
    6d3ddae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions