|
![]() ![]() ![]() |
An application which uses Berkeley DB XML relies on five libraries: Berkeley DB XML, Berkeley DB, Pathan, XQuery and Xerces C++. When compiling, the include files from these packages must be available, and the libraries must be included when linking the application.
When running the application, each of the shared libraries must be located by the dynamic linker, usually controlled by system settings and the LD_LIBRARY_PATH environment variable. See Dynamic shared libraries for more information
Assuming Berkeley DB XML, Berkeley DB, Pathan, Xerces C++ and XQuery have all been installed in the default location, a typical command to compile C++ code that uses Berkeley DB XML is:
If the libraries are in different locations, such as Xerces, Pathan and XQuery in /usr/local, Berkeley DB in /usr/local/BerkeleyDB.4.3, and Berkeley DB XML in /usr/local/BerkeleyDBXML.2.0, a command might be:c++ -c -Ipath_to_distribution/install/include -c myapp.cpp
c++ -c -I/usr/local/include -I/usr/local/BerkeleyDBXML.2.0/include -I/usr/local/BerkeleyDB.4.3/include -c myapp.cpp
Then, corresponding link commands are:
andc++ -o myapp myapp.o -Lpath_to_distribution/install/lib -lpathan -lxquery-lxerces-c -ldbxml-2.0 -ldb_cxx-4.3
c++ -o myapp myapp.o -L/usr/local/lib -L/usr/local/BerkeleyDBXML.2.0/lib -L/usr/local/BerkeleyDB.4.3/lib -lpathan -lxquery -l xerces-c -ldbxml-2.0 -ldb_cxx-4.3
Note the use of -ldb_cxx-4.3 and not -ldb-4.3. Berkeley DB XML uses the Berkeley DB C++ API internally, so the link step will fail if the wrong library is used.
![]() ![]() ![]() |
Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.