- 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_windows 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. The files are:
- 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
- *.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
includes the Berkeley DB 4.5.20 release, and requires the Berkeley DB 4.3.28 release
or later.
- 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.7.0 release or
newer.
- XQilla
- XQilla is an implementation of XQuery 1.0 and XPath 2.0 that uses the
Xerces DOM. The version bundled with Berkeley DB XML is not
available for general download.
These instructions use a Berkeley DB XML release number of
2.3.10. 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.3.10/dbxml/build_windows
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.3.10/lib, DLLs and
executables are installed in
dbxml-2.3.10/bin
or dbxml-2.3.10/bin/debug
depending on the configuration you choose,
.jar files are placed in
dbxml-2.3.10/jar,
and header (include) files for application development
are copied to
dbxml-2.3.10/include.
- 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{/debug} along with other executables.
Building with Microsoft Visual Studio 2005
- Choose File -> Open -> Project/Solution. Look in the
dbxml-2.3.10/dbxml/build_windows
directory for solution files, select BDBXML_all.sln, and press Open.
This will put you into the Visual Studio Conversion Wizard
- Choose Next, and then choose to either create a backup
before conversion or not (creating a backup is recommended). Choose
Next again, then Finish. All project files will
be converted to the Visual Studio 2005 format.
- Choose the project configuration from the drop-down menu on the Visual Studio
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.3.10/lib, DLLs and
executables are installed in
dbxml-2.3.10/bin
or dbxml-2.3.10/bin/debug
depending on the configuration you choose,
.jar files are placed in
dbxml-2.3.10/jar,
and header (include) files for application development
are copied to
dbxml-2.3.10/include.
There are likely to be a number of warnings related to "deprecated"
interfaces in the Microsoft C runtime. The warning number is 4996, and may
mention using "_CRT_SECURE_NO_DEPRECATE." These warnings are expected,
and harmless. If you would like to quiet them down, you can add
"_CRT_SECURE_NO_DEPRECATE=1" to the preprocessor configuration for each
project.
- 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{/debug} along with other executables.
Building with Microsoft Visual C++ 6.0
- Choose File -> Open Workspace. Look in the
dbxml-2.3.10/dbxml/build_windows
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.3.10/lib, DLLs and
executables are installed in
dbxml-2.3.10/bin
or dbxml-2.3.10/bin/debug
depending on the configuration you choose,
.jar files are placed in
dbxml-2.3.10/jar,
and header (include) files for application development
are copied to
dbxml-2.3.10/include.
- By default, BDBXML_all.dsw builds all third-party libraries,
Berkeley DB XML, and Berkeley DB XML C++ examples. The examples are installed in
bin{/debug} along with other executables.
When building your application, you should normally use compile options
"Debug Multithreaded DLL" and link against
lib/libdbxml23d.lib. You can
also build using a release version of the libraries and tools, which
will be placed in
lib/libdbxml23.lib. A safe way
to construct a project file for your application is to adapt one of
the Berkeley DB XML example projects.
Running C++ Examples
After a successful build, the Berkeley DB XML example executable files are in
bin{/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 bin or
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
jar.
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 jar.
- 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_java23.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 jar.
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 bin (Release build)
or bin/debug (Debug build)
subdirectory. On Windows, remember that files or directories in the
CLASSPATH and PATH variables must be separated by
semicolons (unlike UNIX)
Make sure you use the Debug JAR
files with the Debug DLLs and the Release JARs with the Release DLLs.
Running Java Examples
After a successful build, the Berkeley DB XML examples are in
jar/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
bin/debug/libdb_tcl43d.dll or
bin/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
bin/debug/libdbxml_tcl23d.dll or
bin/libdbxml_tcl23.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
bin/debug/libdb_tcl43d.dll or
bin/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_tcl23.dll.
This builds the Tcl support library for Berkeley DB XML, placing the result into
bin/debug/libdbxml_tcl23d.dll or
bin/libdbxml_tcl23.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 the BDBXML_all solution/workspace.
Opening 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_windows. Also add the library paths
db-<version>/build_windows/Debug and
db-<version>/build_windows/Release.
For the source release of Xerces add the include path
xerces-c-src/src. Then add the appropriate
build directory for your compiler, for example,
xerces-c-src/build/win32/vc6/debug and
xerces-c-src/build/win32/vc6/release. Use
vc7.1 instead of vc6 for Visual Studio .NET.
There are no releases of compatible XQilla libraries
available. It is necessary to use those included 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_windows/debug/db.jar for the Debug
configuration, and to
db-<version>/build_windows/release/db.jar for the
Release configuration.
Copyright (c) 1996,2007 Oracle. All rights reserved.