Search code examples
terminalhomebrewconfigurebitcoin

(Configuring Bitcoin core) configure: error: libdb_cxx headers missing


I've downloaded Bitcoin core from Github and am trying to set it up via instructions from Andreas Antonopoulos Bitcoin book Mastering Bitcoin Chapter 3 (The Bitcoin client)

Currently stuck on the configure step, when I run ./configure everything is looking good till it ends with the following error:

...
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for MSG_NOSIGNAL... no
checking for Berkeley DB C++ headers... no
configure: error: libdb_cxx headers missing

I'm using homebrew, how do I fix this error?


Solution

  • Ah figured it out, I didn't completely finish reading all the instructions in the build-osx.md file

    #### Installing berkeley-db4 using Homebrew
    
    The homebrew package for berkeley-db4 has been broken for some time.  It will install without Java though.
    
    Running this command takes you into brew's interactive mode, which allows you to configure, make, and install by hand:
    ```
    $ brew install https://raw.github.com/mxcl/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java 
    ```
    
    These rest of these commands are run inside brew interactive mode:
    ```
    /private/tmp/berkeley-db4-UGpd0O/db-4.8.30 $ cd ..
    /private/tmp/berkeley-db4-UGpd0O $ db-4.8.30/dist/configure --   prefix=/usr/local/Cellar/berkeley-db4/4.8.30 --mandir=/usr/local/Cellar/berkeley-db4/4.8.30/share/man --enable-cxx
    /private/tmp/berkeley-db4-UGpd0O $ make
    /private/tmp/berkeley-db4-UGpd0O $ make install
    /private/tmp/berkeley-db4-UGpd0O $ exit
    ```
    

    After exiting, you'll get a warning that the install is keg-only, which means it wasn't symlinked to /usr/local. You don't need it to link it to build bitcoin, but if you want to, here's how:

    $ brew --force link berkeley-db4