faq.html   [plain text]


<!--$Id: faq.html,v 1.2 2004/03/30 01:22:49 jtownsen Exp $-->
<!--Copyright 1997-2003 by Sleepycat Software, Inc.-->
<!--All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Windows FAQ</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><a name="3"><!--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="../build_win/notes.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../build_vxworks/intro.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p>
<h3 align=center>Windows FAQ</h3>
<ol>
<p><li><b>Why do I have db_load.dll - where is db_load.exe?</b>
<p>Microsoft Visual C++ .NET has some bugs related to converting project
files from VC++ 6.0 format and incorrectly converts the db_load project.
For more information, see <a href="http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q321274&">Microsoft's article about this bug</a>.</p>
<p>The workaround is simply to switch the <b>db_load</b> project back to
generating an EXE after converting to VC++ .NET.  To do this, right
click on db_load -&gt; Properties and change "Configuration Type" from
"Dynamic Library (.dll)" to "Application (.exe)".</p>
<p><li><b>My Win* C/C++ application crashes in the Berkeley DB library when Berkeley DB calls
fprintf (or some other standard C library function).</b>
<p>You should be using the "Debug Multithreaded DLL" compiler option in
your application when you link with the
build_win32/Debug/libdb42d.lib library (this .lib file
is actually a stub for libdb42d.DLL). To check this
setting in Visual C++, choose the <i>Project/Settings</i> menu
item and select <i>Code Generation</i> under the tab marked
<i>C/C++</i>; and see the box marked <i>Use runtime
library</i>.  This should be set to <i>Debug Multithreaded DLL</i>.
If your application is linked against the static library,
build_win32/Debug/libdb42sd.lib; then, you will want
to set <i>Use runtime library</i> to <i>Debug Multithreaded</i>.</p>
<p>Setting this option incorrectly can cause multiple versions of the
standard libraries to be linked into your application (one on behalf
of your application, and one on behalf of the Berkeley DB library).  That
violates assumptions made by these libraries, and traps can result.</p>
<p><li><b>Why are the build options for DB_DLL marked as "Use MFC in a Shared DLL"?
Does Berkeley DB use MFC?</b>
<p>Berkeley DB does not use MFC at all.  It does however, call malloc and free
and other facilities provided by the Microsoft C runtime library.  We
found in our work that many applications and libraries are built
assuming MFC, and specifying this for Berkeley DB solves various
interoperation issues, and guarantees that the right runtime libraries
are selected.  Note that because we do not use MFC facilities, the MFC
library DLL is not marked as a dependency for libdb.dll, but the
appropriate Microsoft C runtime is.</p>
<p><li><b>How do I enable diagnostic mode on Windows?</b>
<p>You will need to edit <b>build_win32/db_config.h</b> and change this line:
<blockquote><pre>/* #undef HAVE_DIAGNOSTIC */</pre></blockquote>
to this:
<blockquote><pre>#define HAVE_DIAGNOSTIC 1</pre></blockquote></p>
<p>Then add this line to the end of <b>build_win32/libdb.def</b>:
<blockquote><pre>__db_assert     @123</pre></blockquote>
Change the '123' above to the last entry in the file plus one.</p>
<a name="4"><!--meow--></a>
<p><li><b>How can I build Berkeley DB for <a href="http://www.mingw.org">MinGW</a>?</b>
<p>Follow the instructions in <a href="../../ref/build_unix/intro.html">Building for UNIX/POSIX</a>, and specify the --enable-mingw option to the
configuration script.  This configuration option currently only builds
static versions of the library, it does not yet build a DLL version of
the library.</p>
<p><li><b>The test suite hangs under Windows.</b>
<p>There are bugs in some versions of Tcl that may cause the test suite to
hang on Windows (specifically, we've seen hangs on Windows/NT 4.0).  If
you want to run the test suite against a Debug version of Berkeley DB, you
need to build a Debug version of Tcl, which requires building Tcl from
source.</p>
</ol>
<table width="100%"><tr><td><br></td><td align=right><a href="../build_win/notes.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../build_vxworks/intro.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2003</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font>
</body>
</html>