bitcoin: configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality...
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?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (1 by maintainers)
sudo add-apt-repository ppa:bitcoin/bitcoin sudo apt-get update sudo apt-get install libdb4.8-dev libdb4.8+±dev
😉
Just follow the build docs:
The Bitcoin Core source contains a script
contrib/install_db4.sh
that downloads and compiles bdb4.8 locally.Then configure bitcoin core with
for me it was helpful to install libboost-all-dev 😃
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
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.
sudo apt update && sudo apt install libdb5.3++ libdb5.3++-dev
@scottie 's method don’t work for me. OS: Debian 9.9
if build Bitcoin Core without wallet, it will not emit this error
ref: https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#ubuntu--debian
The solution, at least for Ubuntu 21.10, at the time of writing is:
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.
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 theinclude/
).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).