1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
<!--"@(#)intro.so 10.26 (Sleepycat) 11/18/99"-->
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
<!--All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Building for Win32</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a>
<table width="100%"><tr valign=top>
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Building Berkeley DB for Windows systems</dl></h3></td>
<td align=right><a href="../../ref/build_unix/ultrix.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/build_win/test.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p>
<h1 align=center>Building for Win32</h1>
<p>The build_win32 directory in the Berkeley DB distribution contains project files
for Microsoft Visual C++:
<p><table border=1 align=center>
<tr><th>Project File</th><th>Description</th></tr>
<tr> <td align=center>Berkeley_DB.dsw</td> <td align=center>Visual C++ 6.0 workspace</td> </tr>
<tr> <td align=center>*.dsp</td> <td align=center>Visual C++ 6.0 projects</td> </tr>
</table>
<p>These project files can be used to build Berkeley DB for any Win32 platform:
Windows/XP, Windows/2000, Windows/NT, Windows/98 and Windows/95.
<h3>Building Berkeley DB with Visual C++</h3>
<p>Open the file <b>Berkeley_DB.dsw</b>. This workspace includes a number
of subprojects needed to build Berkeley DB. To do this in Visual C++ .NET,
choose <i>Open Solution</i> from the <i>File</i> menu. Then
choose <i>Compatible Workspace Files</i> under <i>Files of
type</i>. After you select <b>Berkeley_DB.dsw</b>, you will be prompted to
upgrade the project files. Choose <i>Yes to All</i>.
<p>First, you'll need to set the include directories. To do this, select
<i>Options...</i> from the <i>Tools</i> pull-down menu. In Visual
C++ 6.0, a tabbed dialog should appear. Choose the <i>Directories</i>
tab in the dialog, and for the <i>Platform</i>, select
<i>Win32</i>. In Visual C++ .NET, a different window appears. Choose
<i>Projects</i>, then <i>VC++ Directories</i>.
<p>In either case, choose <i>Include files</i> under <i>Show
directories for</i>. You should then add two directories to the list of
directories: the full pathname of the <i>build_win32</i> subdirectory
of Berkeley DB, followed by the full pathname of the <i>dbinc</i>
subdirectory of Berkeley DB. Then click OK.
<p>In Visual C++ 6.0, select <i>Active Project Configuration</i> under
the <i>Build</i> pull-down menu. For a debug version of the
libraries, tools, and examples, select <i>build_all -- Win32
Debug</i>. Results from this build are put into <b>build_win32/Debug</b>.
For a release version, select <i>build_all -- Win32 Release</i>;
results are put into <b>build_win32/Release</b>. For a debug version
that has all tools and examples built with static libraries, select
<i>build_all -- Win32 Debug Static</i>; results are put into
<b>build_win32/Debug_static</b>. For a release version of the same,
select <i>build_all -- Win32 Release Static</i>; results are put into
<b>build_win32/Release_static</b>. Finally, to build, select
<i>Build build_all.exe</i> under the <i>Build</i> pull-down
menu.
<p>In Visual C++ .NET, choose the configuration from the drop down list on
the tool bar (<i>Debug</i>, <i>Release</i>, <i>Debug
Static</i> or <i>Release Static</i>). Then, to build, right-click on
<i>build_all</i> and choose <i>Build</i>.
<p>When building your application, you should normally use compile options
"debug multithreaded dll" and link against
<b>build_win32/Debug/libdb41d.lib</b>. If you want to
link against a static (non-DLL) version of the library, use the "debug
multithreaded" compile options and link against
<b>build_win32/Debug_static/libdb41sd.lib</b>. You
can also build using a release version of the libraries and tools, which
will be placed in
<b>build_win32/Release/libdb41.lib</b>. The static
version will be in
<b>build_win32/Release_static/libdb41s.lib</b>.
<p>Each release of Berkeley DB is built and tested with this procedure using
Microsoft Visual C++ 6.0, Standard Version and Microsoft Visual C++ .NET,
Standard Version.
<h3>Building the C++ API</h3>
<p>C++ support is built automatically on Win32.
<h3>Building the Java API</h3>
<p>Java support is not built automatically. The following instructions
assume that you have installed the Sun Java Development Kit in
<b>d:/java</b>. Of course, if you installed elsewhere or have different
Java software, you will need to adjust the pathnames accordingly. First,
use the previous instructions to open the Tools/Options window for adding
include directories. In addition to the directories specified previously,
add <b>d:/java/include</b> and <b>d:/java/include/win32</b>. These
are the directories needed when including <b>jni.h</b>. Now, before
clicking OK, choose <i>Executable files</i> under <i>Show
directories for</i>. Add <b>d:/java/bin</b>. That directory is needed to
find javac. Now select OK.
<p>In Visual C++ 6.0, select <i>Active Project Configuration</i> under
the <i>Build</i> pull-down menu. Choose <i>db_java -- Win32
Release</i>. To build, select <i>Build
libdb_java41.dll</i> under the <i>Build</i> pull-down
menu. This builds the Java support library for Berkeley DB and compiles all the
java files, placing the resulting <b>db.jar</b> and
<b>dbexamples.jar</b> files in the <b>build_win32/Release</b>
subdirectory of Berkeley DB.
<p>In Visual C++ .NET, set the build type to <i>Release</i> in the drop
down list on the toolbar, then right-click on <i>db_java</i> and
choose <i>Build</i>.
<p>To run Java code, set your environment variable <b>CLASSPATH</b> to
include the full pathname of these jar files, and your environment
variable <b>PATH</b> to include the <b>build_win32/Release</b>
subdirectory. On Windows, remember that files or directories in the
<b>CLASSPATH</b> and <b>PATH</b> variables must be separated by
semicolons (unlike UNIX). Then, try running the following command as a
test:
<p><blockquote><pre>java com.sleepycat.examples.AccessExample</pre></blockquote>
<p>If you want to run Java code using a Debug build, it is slightly more
complicated. Make sure you build the Debug version of <i>db_java</i>
instead of the Release version. Also make sure that your <b>PATH</b>
contains <b>build_win32/Debug</b>. Then run the following (as one
command):
<p><blockquote><pre>java -dsleepycat.db.libname=libdb_java41d com.sleepycat.examples.AccessExample</pre></blockquote>
<h3>Building the Tcl API</h3>
<p>Tcl support is not built automatically. See
<a href="../../ref/tcl/intro.html">Loading Berkeley DB with Tcl</a> for information on
sites from which you can download Tcl and which Tcl versions are
compatible with Berkeley DB.
<p>The Tcl library must be built as the same build type as the Berkeley DB library
(both Release or both Debug). We found that the binary release of Tcl can
be used with the Release configuration of Berkeley DB, but you will need to need
to build Tcl from sources for the Debug configuration. Before building
Tcl, you will need to modify its makefile to make sure that you are
building a debug version, including thread support. This is because the
set of DLLs linked into the Tcl executable must match the corresponding
set of DLLs used by Berkeley DB.
<p>These notes assume that Tcl is installed as <b>d:/tcl</b>, but you can
change that if you want. If you run using a version of Tcl different from
the one currently being used by Sleepycat Software, you will need to
change the name of the Tcl library used in the build (for example,
<b>tcl83d.lib</b>) to the appropriate name. See
Projects->Settings->Link in the db_tcl subproject.
<p>Use the previous instructions for Visual C++ to open the
<i>Tools/Options</i> window for adding include directories. In
addition to the directories specified previously, add
<b>d:/tcl/include</b>. This is the directory that contains
<b>tcl.h</b>. Then, in that same window, choose <i>Library
Files</i> under <i>Show directories for</i>. Add <b>d:/tcl/lib</b> (or
whatever directory contains <b>tcl83d.lib</b> in your distribution) to
the list. Now, select OK.
<p>In Visual C++ 6.0, select <i>Active Project Configuration</i> under
the <i>Build</i> pull-down menu. Choose <i>db_tcl -- Win32
Release</i>. To build, select <i>Build
libdb_tcl41.dll</i> under the <i>Build</i> pull-down
menu. This builds the Tcl support library for Berkeley DB, placing the result
into <b>build_win32/Release/libdb_tcl41.dll</b>.
Selecting an Active Configuration of <i>db_tcl -- Win32 Debug</i> will
build a debug version, placing the result into
<b>build_win32/Debug/libdb_tcl41d.dll</b>.
<p>In Visual C++ .NET, choose the build type (<i>Debug</i> or
<i>Release</i>) from the drop down list on the toolbar, then
right-click on <i>db_tcl</i> and choose <i>Build</i>.
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/build_unix/ultrix.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/build_win/test.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
</body>
</html>
|