- Berkeley DB XML Reference Guide:
- Building Berkeley DB XML for Windows systems
|
 
|
Building Berkeley DB XML for Windows
If you are working with the
source release of Berkeley DB XML, follow the
build instructions below.
Building Berkeley DB XML
The build_win32 directory in the Berkeley DB XML source distribution contains
project files, workspace files, and solution files for Microsoft Visual
Studio versions 6 and 7.1. These correspond to Visual C++ 6 and
Microsoft Visual Studio .NET 2003, respectively. In addition,
there are several different workspace/solution files, depending
on needs:
- BDBXML_all.sln
- MSVC7.1 solution file, including projects for all third-party libraries, and Berkeley DB XML examples
- BDBXML_all.dsw
- MSVC6.0 workspace file, including projects for all third-party libraries,
and Berkeley DB XML examples
- Berkeley_DB_XML.sln
- MSVC7.1 solution file, with projects for Berkeley DB XML libraries only, without examples
- Berkeley_DB_XML.dsw
- MSVC6.0 workspace file, with projects for Berkeley DB XML libraries only, without
examples
- dbxml_gettingStarted.sln
- MSVC7.1 solution file, with projects for Berkeley DB XML examples only
- dbxml_gettingStarted.sln
- MSVC6.0 workspace file, with projects for Berkeley DB XML examples only
- *.vcproj
- MSVC7.1 projects
- *.dsp
- MSVC6.0 projects
These project files can be used to build Berkeley DB XML for any Win32
platform: Windows/XP, Windows/2000, Windows/NT and Windows/98.
Berkeley DB XML makes use of several third-party libraries. Each of these
packages is freely available and distributed under an Open Source
license. The Berkeley DB XML distribution includes compatible versions
of all third-party libraries. No additional downloads are required.
Use of other versions may not work, and may not be supported.
Berkeley DB XML requires the following third-party libraries:
- Berkeley DB
- Berkeley DB is a general purpose database toolkit. This release of Berkeley DB XML
requires Sleepycat Software's Berkeley DB 4.3.25 release or higher.
- Xerces
- Xerces is the Apache implementation of XML parsing technology
and DOM. The build requires a source
release of Xerces, not just a binary release. This release of Berkeley DB XML
requires the Xerces 2.6.0 release or newer.
- Pathan
- Pathan is an XPath 2.0 implementation that uses the Xerces DOM implementation.
Berkeley DB XML requires a Pathan release that is not yet available for general
download.
- XQuery
- XQuery is an XQuery library built on Pathan and Xerces DOM that is
compliant to a draft of the XQuery 1.0 recommendation from the
W3C, and will be ultimately compliant to the recommendation itself.
It is not yet available for general download.
These instructions use a Berkeley DB XML release number of
2.0.7. If that is not your release,
adjust your paths accordingly.
Building with Microsoft Visual Studio .NET
- Choose File -> Open Solution. Look in the
dbxml-2.0.7/dbxml/build_win32
directory for solution files, select BDBXML_all.sln, and press Open.
- Choose the project configuration from the drop-down menu on the .NET
tool bar (Debug, Release, Debug Static or Release Static).
- To build, select Build Solution from the
Build drop-down menu.
All library files (*.lib) are placed
in dbxml-2.0.7/dbxml/lib and
DLLs, executables, and .jar files are installed in
dbxml-2.0.7/dbxml/bin/{Release,Debug},
depending on the configuration you chose.
- By default, BDBXML_all.sln builds all third-party libraries,
Berkeley DB XML, and Berkeley DB XML C++ examples. The examples are installed in
bin/{Release,Debug} along with other executables.
Building with Microsoft Visual C++ 6.0
- Choose File -> Open Workspace. Look in the
dbxml-2.0.7/dbxml/build_win32
directory for Workspaces, select BDBXML_all.dsw, and press Open.
- Choose the desired project configuration by going to Build
-> Set Active Configuration and select the appropriate option
to the all project (Debug, Release). Then click OK.
- To build, select Build -> Build all.exe.
All library files (*.lib) are placed
in dbxml-2.0.7/dbxml/lib and
DLLs, executables, and .jar files are installed in
dbxml-2.0.7/dbxml/bin/{Release,Debug},
depending on the configuration you chose.
- By default, BDBXML_all.dsw builds all third-party libraries,
Berkeley DB XML, and Berkeley DB XML C++ examples. The examples are installed in
dbxml/bin/{Release,Debug} along with other executables.
When building your application, you should normally use compile
options "Debug Multithreaded DLL" and link against
dbxml/lib/libdbxml20d.lib.
You can also build using a release version of the libraries and tools,
which will be placed in
dbxml/lib/libdbxml20.lib.
Running C++ Examples
After a successful build, the Berkeley DB XML example executable files are in
dbxml/bin/{Release,Debug}. See dbxml/examples/cxx/gettingStarted/Readme.txt for instructions on building the C++ example
containers and running examples.
Building the Java API with Visual Studio .NET
The Berkeley DB XML Java API is not built automatically. The following
instructions assume that you have installed the Sun Java Development
Kit in d:/java. Of course, if you installed elsewhere or have
different Java software, you will need to adjust the pathnames
accordingly.
- Set your include directories. Choose Tools -> Options
-> Projects -> VC++ Directories. Under the "Show
directories for" pull-down, select "Include files". Add the full
pathnames for the java/include and
java/include/win32 directories. Then click OK. These are
the directories needed when including jni.h.
- Set the executable files directories. Choose Tools ->
Options -> Projects -> VC++ Directories. Under the "Show
directories for" pull-down, select "Executable files". Add the full
pathname for the java/bin directory, then click OK. This is
the directory needed to find javac.
- Set the build type to Release or Debug in the drop-down on the .NET
tool bar.
- Right-click on db_java and select Build. This builds the
Java support library for Berkeley DB, which is required for Berkeley DB XML,
and compiles all the java files,
placing the resulting db.jar and dbexamples.jar
files in dbxml/bin/Release or
dbxml/bin/Debug.
- Right-click on dbxml_java and select Build.
This builds the Java support library for Berkeley DB XML and compiles all the java files,
placing the resulting dbxml.jar and dbxmlexamples.jar
files in dbxml/bin/Release or
dbxml/bin/Debug.
Building Java with Visual C++ 6.0
- Set the include directories. Choose Tools -> Options
-> Directories. Under the "Show directories for" pull-down,
select "Include files". Add the full pathnames for the
java/include and java/include/win32 directories.
These are the directories needed when including jni.h.
- Set the executable files directories. Choose Tools ->
Options -> Directories. Under the "Show directories for"
pull-down, select "Executable files". Add the full pathname for the
java/bin directory. This is the directory needed to find
javac.
- Go to Build -> Set Active Configuration and select
either the Debug or Release version of the db_java project. Then
press OK.
- Select Build -> Build
libdb_java43.dll. This builds the Java support
library for Berkeley DB, which is required for Berkeley DB XML,
and compiles all the java files, placing the
resulting db.jar and dbexamples.jar files in
dbxml/bin/Release or dbxml/bin/Debug.
- Go to Build -> Set Active Configuration and select
either the Debug or Release version of the dbxml_java project. Then
press OK.
- Select Build -> Build
libdbxml_java20.dll. This builds the Java support
library for Berkeley DB XML,
and compiles all the java files, placing the
resulting dbxml.jar and dbxmlexamples.jar files in
dbxml/bin/Release or dbxml/bin/Debug.
To run Java code, set your environment variable CLASSPATH
to include the full pathname of these jar files, and your environment
variable PATH to include the dbxml/bin/Release
subdirectory. On Windows, remember that files or directories in the
CLASSPATH and PATH variables must be separated
by semicolons (unlike UNIX). Then, try running the following command
as a test:
java com.sleepycat.examples.db.AccessExample
If you want to run Java code using a Debug build, substitute 'Debug'
for 'Release' in the instructions above. Make sure you use the Debug
JAR file with the Debug DLL and the Release JAR with the Release
DLL.
Running Java Examples
After a successful build, the Berkeley DB XML examples are in
dbxml/bin/{Release,Debug}/dbxmlexamples.jar.
See dbxml/examples/java/gettingStarted/Readme.txt for instructions
on building the Java example containers and running Java examples.
Building the Tcl API
Tcl support is not built automatically. See
Loading Berkeley DB with Tcl for
information on sites from which you can download Tcl and which Tcl
versions are compatible with Berkeley DB. These notes assume that Tcl is
installed as d:/tcl, but you can change that if you want.
The Tcl library must be built as the same build type as the Berkeley DB
and Berkeley DB XML libraries (both Release or both Debug). We found that the binary
release of Tcl can be used with the Release configurations of Berkeley DB
and Berkeley DB XML,
but you will 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
and Berkeley DB XML.
Building Tcl with Visual C++ .NET
- Set the include directories. Choose Tools -> Options
-> Projects -> VC++ Directories. Under the "Show
directories for" pull-down, select "Include files". Add the full
pathname for tcl/include, then click OK. This is the
directory that contains tcl.h.
- Set the library files directory. Choose Tools ->
Options -> Projects -> VC++ Directories. Under the "Show
directories for" pull-down menu, select "Library files". Add the full
pathname for the tcl/lib directory, then click OK. This is
the directory needed to find
tcl84g.lib (or whatever the
library is named in your distribution).
- Set the build type to Release or Debug in the drop-down on the .NET
tool bar.
- Right-click on db_tcl and select Build. This builds the Tcl
support library for Berkeley DB, which is required for Berkeley DB XML,
placing the result into
dbxml/bin/Debug/libdb_tcl43d.dll or
dbxml/bin/Release/libdb_tcl43.dll.
- Right-click on dbxml_tcl and select Build. This builds the Tcl
support library for Berkeley DB XML, placing the result into
dbxml/bin/Debug/libdbxml_tcl2M4XMLMINORd.dll or
dbxml/bin/Release/libdbxml_tcl20.dll.
If you use a version different from Tcl 8.4.x you will
need to change the name of the Tcl library used in the build (for
example, tcl84g.lib) to the
appropriate name. To do this, right click on db_tcl, go to
Properties -> Linker -> Input -> Additional
dependencies and change
tcl84g.lib to match the Tcl
version you are using.
Building Tcl with Visual C++ 6.0
- Set the include directories. Choose Tools -> Options
-> Directories. Under the "Show directories for" pull-down menu,
select "Include files". Add the full pathname for
tcl/include, then click OK. This is the directory that
contains tcl.h.
- Set the library files directory. Choose Tools ->
Options -> Directories. Under the "Show directories for"
pull-down menu, select "Library files". Add the full pathname for the
tcl/lib directory, then click OK. This is the directory
needed to find tcl84g.lib (or
whatever the library is named in your distribution).
- Go to Build -> Set Active Configuration and select
either the Debug or Release version of the db_tcl project. Then press
OK.
- Select Build -> Build
libdb_tcl43.dll. This builds the Tcl support
library for Berkeley DB, which is required for Berkeley DB XML, placing the result into
dbxml/bin/Debug/libdb_tcl43d.dll or
dbxml/bin/Release/libdb_tcl43.dll.
- Go to Build -> Set Active Configuration and select
either the Debug or Release version of the dbxml_tcl project. Then press
OK.
- Select Build -> Build
libdbxml_tcl20.dll. This builds the Tcl support
library for Berkeley DB XML, placing the result into
dbxml/bin/Debug/libdbxml_tcl2M4XMLMINORd.dll or
dbxml/bin/Release/libdbxml_tcl20.dll.
If you use a version different from Tcl 8.4.x you will
need to change the name of the Tcl library used in the build (for
example, tcl84g.lib) to the
appropriate name. To do this, choose
Project -> Settings -> db_tcl
and change the Tcl library listed in the Object/Library modules
tcl84g.lib to match the Tcl version
you are using.
Building with third-party libraries in other directories
The Berkeley DB XML source distribution includes compatible versions of necessary
third-party libraries. The BDBXML_all solution builds them.
This section is for advanced building, where libraries are not
located in the directories as expected by the distribution.
Berkeley DB XML can be built with third-party libraries that are not located in
the Berkeley DB XML default location. In this case, use either BDBXML_all
or Berkeley_DB_XML solution/workspace. Opening either may
generate warnings that project files cannot be found. In this
case, those warnings can be ignored.
In Visual C++ open the
Tools/Options tabbed dialog for adding directories. Add the include
and library paths for the third-party libraries located elsewhere.
To do this, select Options... from the Tools
pull-down menu. In Visual C++ 6.0, a tabbed dialog should appear.
Choose the Directories tab in the dialog, and for the
Platform, select Win32. In Visual Studio .NET, a
different window appears. Choose Projects, then
VC++ Directories.
In either case, use Include files under Show
directories for to add include directories, and Library
files for library paths.
For Berkeley DB add the include path db-<version>,
db-<version>/build_win32. Also add the library paths
db-<version>/build_win32/Debug and
db-<version>/build_win32/Release.
For the source release of Xerces add the include path
xerces-c-<version>/src. Then add the
appropriate build directory for your compiler, e.g.
xerces-c-<version>/build/win32/vc6/debug and
xerces-c-<version>/build/win32/vc6/release.
Use vc7 instead of vc6 for Visual Studio .NET.
There are no releases of compatible Pathan or XQuery libraries
available. It is necessary to use those include in the Berkeley DB XML
distribution.
The dbxml_java project includes a Custom Build Step that includes
the path to the Berkeley DB .jar file three times. These must be changed to
db-<version>/build_win32/debug/db.jar for the
Debug configuration, and to
db-<version>/build_win32/release/db.jar for the
Release configuration.
Reporting problems
If you have trouble with any of these commands, please send email to
support@sleepycat.com. In that email, please include the following
information:
- The version of Berkeley DB XML you are trying to build.
- The name and version of the C++ compiler you are using.
- The name and version of the operating system you are using.
- A cut and paste of any error messages generated by the
compiler.
Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.