19

When building bitcoind on LinuxCoin (Debian based), I receive this error

"headers.h:36:20: fatal error: db_cxx.h: No such file or directory"

following the instructions at https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.txt

I believe the error is caused by the package "libdb4.8++-dev" being non-existant for the distro, as when attempting to "apt-get install" that, I get:

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

NOTE: libdb4.8-dev and all other dependencies are already installed.

It's probably a silly mistake on my part but any help is appreciated! Thanks.

Sean Chapman
  • 1,740
  • 1
  • 17
  • 30

6 Answers6

20

I did the following command on Ubuntu and it worked.

sudo apt-get install libdb++-dev
Kieran Andrews
  • 301
  • 2
  • 3
7

You need to add -I <directory> to the end of the CXX=g++ line in the Makefile. The directory should be the one that contains the db_cxx.h file from your BerkeleyDB installation. So, change:

CXX=g++

to

CXX=g++ -I /usr/local/BerkeleyDB.5.1

You may need a /include or something like that on the end of that. It depends exactly which directory holds the db_cxx.h file.

David Schwartz
  • 51,554
  • 6
  • 106
  • 178
5

I think you can install the libdb4.8++-dev package if you add the stable debian repo in your sources.list.

I did it on my system (debian sid), and now I can proceed to the installation. I haven't tested the full bitcoind compilation yet, though.

grondilu
  • 51
  • 1
  • 1
  • 1
    libdb5.1++-dev also works, for those who would rather install later versions of packages. +1 thanks! – L0j1k Mar 10 '13 at 23:56
1

it compiles nice with later versions but be carefull and do not mix up db*-dev and db*++-dev. Here you have to install the "++" version

0

If you're building under homebrew on MacOS, install the requisite header files via

brew install berkeley-db
jhfrontz
  • 113
  • 4
0

Try this:

sudo apt-get install libdb5.3++-dev

The latest stable package, I used this on the new Bitcoin-Qt 8.3 patch from GIT and it compiled flawlessly, for any files that had that as an include.

Note:

If you are using gcc / g++ version 4.8 and you were looking for libdb4.8++-dev, there is a reason why you couldn't find an installation candidate.

Don't confuse the libdb5.3++-dev package with the version of the gcc / g++ compiler and linker, they're not part of the gcc / g++ but an add-on development library regardless of what version of the compiler you use.

user6016
  • 79
  • 2