Chapter 4.  Building Berkeley DB for Windows

Table of Contents

Building Berkeley DB for Windows
Visual C++ .NET 2015
Visual C++ .NET 2013
Visual C++ .NET 2012
Visual C++ .NET 2010
Build results
Building Berkeley DB with Cygwin
Building the C++ API
Building the C++ STL API
Building the Java API
Building the C# API
Building the Tcl API
Building Secure Sockets Layer (SSL) Support for the Replication Manager
Distributing DLLs
Additional build options
Building a small memory footprint library
Running the test suite under Windows
Building the software needed by the tests
Running the test suite under Windows
Windows notes
Windows FAQ

This chapter contains general instructions on building Berkeley DB for specific windows platforms using specific compilers. The Windows FAQ also contains helpful information.

The build_windows directory in the Berkeley DB distribution contains project files for Microsoft Visual Studio:

Project File Description
Berkeley_DB_vs2010.sln Visual Studio 2010 workspace
VS10\*.vcxproj Visual Studio 2010 projects
Berkeley_DB_vs2012.sln Visual Studio 2012 workspace
VS12\*.vcxproj Visual Studio 2012 projects
Berkeley_DB_vs2015.sln Visual Studio 2015 workspace
VS15\*.vcxproj Visual Studio 2015 projects

These project files can be used to build Berkeley DB for Windows Server 2008, Windows Vista, Windows 7, Windows Server 2008 R2, and Windows 8.

Building Berkeley DB for Windows

Visual C++ .NET 2015

  1. Choose File -> Open -> Project/Solution.... In the build_windows directory, select Berkeley_DB_vs2015.sln and click Open.
  2. Choose the desired project configuration from the drop-down menu on the tool bar (either Debug or Release).
  3. Choose the desired platform configuration from the drop-down menu on the tool bar.
  4. To build, right-click on the Berkeley_DB_vs2015 solution and select Build Solution.

Visual C++ .NET 2013

  1. To build with Visual C++ .NET 2013, use the Visual Studio 2012 file and upgrade.
  2. Choose File -> Open -> Project/Solution.... In the build_windows directory, select Berkeley_DB_vs2012.sln and click Open. The Upgrade VC++ Compiler and Libraries dialog box will appear. Click OK to upgrade.
  3. Choose the desired project configuration from the drop-down menu on the tool bar (either Debug or Release).
  4. Choose the desired platform configuration from the drop-down menu on the tool bar.
  5. To build, right-click on the Berkeley_DB_vs2012 solution and select Build Solution.

Visual C++ .NET 2012

  1. Choose File -> Open -> Project/Solution.... In the build_windows directory, select Berkeley_DB_vs2012.sln and click Open.
  2. Choose the desired project configuration from the drop-down menu on the tool bar (either Debug or Release).
  3. Choose the desired platform configuration from the drop-down menu on the tool bar (usually Win32 or x64).
  4. To build, right-click on the Berkeley_DB_vs2012 solution and select Build Solution.

Visual C++ .NET 2010

  1. Choose File -> Open -> Project/Solution.... In the build_windows directory, select Berkeley_DB_vs2010.sln and click Open.
  2. Choose the desired project configuration from the drop-down menu on the tool bar (either Debug or Release).
  3. Choose the desired platform configuration from the drop-down menu on the tool bar (usually Win32 or x64).
  4. To build, right-click on the Berkeley_DB_vs2010 solution and select Build Solution.

Build results

The results of your build will be placed in one of the following Berkeley DB subdirectories, depending on the configuration that you chose:

build_windows\x64\Debug
build_windows\x64\Release
build_windows\x64\Debug_static
build_windows\x64\Release_static
build_windows\Win32\Debug
build_windows\Win32\Release
build_windows\Win32\Debug_static
build_windows\Win32\Release_static

When building your application during development, you should normally use compile options "Debug Multithreaded DLL" and link against build_windows\Debug\libdb181d.lib.

Note

Building your application with the debug configuration will create a Berkeley DB library and utilities with debugging symbols, as well as load various routines that can be called from a debugger to display pages, cursor queues, and so forth. If installed, the utilities will not be stripped. This configuration should not be specified when building production binaries.

You can also build using a release version of the Berkeley DB libraries and tools, which will be placed in build_windows\Win32\Release\libdb181.lib. When linking against the release build, you should compile your code with the "Release Multithreaded DLL" compile option. You will also need to add the build_windows directory to the list of include directories of your application's project, or copy the Berkeley DB include files to another location.