Could not locate BerkeleyDB

I am trying to install a bitcoin-repote-rpc miner from [http://www.mediafire.com/file/ve608cl5mk1ka3l/bitcoin-remote-rpc-20110227-src.zip] on my laptop running on ubuntu quantal. I need to use CMake to build the project. I have encountered a few errors and I have managed to solve them by installing the dependencies. Now the last bit which I am unable to solve is this error message

CMake Error at CMakeLists.txt:112 (MESSAGE):
  Could not locate BerkeleyDB

I would like to know how to solve this problem. Thanking you in advance.

When I run

  dpkg -l 'libdb*' | grep '^ii'

I get the following packages already installed

 ii  libdb5.1:i386                             5.1.29-5ubuntu2                            i386         Berkeley v5.1 Database Libraries [runtime]
ii  libdbus-1-3:i386                          1.6.4-1ubuntu4                             i386         simple interprocess messaging system (library)
ii  libdbus-glib-1-2:i386                     0.100-1ubuntu0.1                           i386         simple interprocess messaging system (GLib-based shared library)
ii  libdbusmenu-glib4:i386                    12.10.2-0ubuntu1                           i386         library for passing menus over DBus
ii  libdbusmenu-gtk3-4:i386                   12.10.2-0ubuntu1                           i386         library for passing menus over DBus - GTK+ version
ii  libdbusmenu-gtk4:i386                     12.10.2-0ubuntu1                           i386         library for passing menus over DBus - GTK+ version
ii  libdbusmenu-qt2:i386                      0.9.2-0ubuntu3                             i386         Qt implementation of the DBusMenu protocol

And this is the part from the CMakelists.txt which seems to be producing the error

# Use BDB local module
FIND_PACKAGE(BerkeleyDB)

IF(DB_INCLUDE_DIR)
    INCLUDE_DIRECTORIES(${DB_INCLUDE_DIR})
ELSE(DB_INCLUDE_DIR)
    MESSAGE(FATAL_ERROR "Could not locate BerkeleyDB")
ENDIF(DB_INCLUDE_DIR)

Solution 1:

There might be two reasons:

  1. (Simple) Do you have libdb-dev and libdb++-dev installed?
  2. If the answer to first question is yes, then the usual reason for failing the builds is non-existent support for newer version of Berkeley DB. You will need to edit the CMakeLists.txt and mangle it to accept libdb-5.1.so or libdb++-5.1.so in case of C++.