Chapter 5. Building Berkeley DB for Windows
Table of Contents
Building Berkeley DB for 32 bit Windows
Building Berkeley DB for 64-bit Windows
x64 build with Visual Studio 2005 or newer
Building Berkeley DB with Cygwin
Binary Compatibility With SQLite
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
Building the software needed by the SQL tests
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.sln | Visual Studio 2005 (8.0) workspace |
| *.vcproj | Visual Studio 2005 (8.0) projects |
| Berkeley_DB_vs2010.sln | Visual Studio 2010 workspace |
| *.vcxproj | Visual Studio 2010 projects |
These project files can be used to build Berkeley DB for the following platforms: Windows NT/2K/XP/2003/Vista and Windows7; and 64-bit Windows XP/2003/Vista and Windows7.
Building Berkeley DB for 32 bit Windows
Visual C++ .NET 2010
- Choose File -> Open -> Project/Solution.... In the
build_windowsdirectory, selectBerkeley_DB_vs2010.slnand click Open. - Choose the desired project configuration from the drop-down menu on the tool bar (either Debug or Release).
- Choose the desired platform configuration from the drop-down menu on the tool bar (usually Win32 or x64).
- To build, right-click on the
Berkeley_DB_vs2010solution and select Build Solution.
Visual C++ .NET 2008
- Choose File -> Open -> Project/Solution.... In the
build_windowsdirectory, selectBerkeley_DB.slnand click Open. - The Visual Studio Conversion Wizard will open automatically. Click the Finish button.
- On the next screen click the Close button.
- Choose the desired project configuration from the drop-down menu on the tool bar (either Debug or Release).
- Choose the desired platform configuration from the drop-down menu on the tool bar (usually Win32 or x64).
- To build, right-click on the Berkeley_DB solution and select Build Solution.
Visual C++ .NET 2005
- Choose File -> Open -> Project/Solution.... In the
build_windowsdirectory, selectBerkeley_DB.slnand click Open - Choose the desired project configuration from the drop-down menu on the tool bar (either Debug or Release).
- Choose the desired platform configuration from the drop-down menu on the tool bar (usually Win32 or x64).
- To build, right-click on the Berkeley_DB 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\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\libdb53d.lib. You can also build using a release version of the Berkeley DB libraries and tools, which will be placed in build_windows\Win32\Release\libdb53.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.