1<!--$Id: faq.so,v 10.37 2007/05/30 08:39:08 alexg Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB Reference Guide: Windows FAQ</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<a name="2"><!--meow--></a><a name="3"><!--meow--></a> 12<table width="100%"><tr valign=top> 13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Building Berkeley DB for Windows systems</dl></b></td> 14<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_wince/intro.html"><img src="/images/next.gif" alt="Next"></a> 15</td></tr></table> 16<p align=center><b>Windows FAQ</b></p> 17<ol> 18<p><li><b>Why do I have db_load.dll - where is db_load.exe?</b> 19<p>Microsoft Visual C++ .NET has some bugs related to converting project 20files from VC++ 6.0 format and incorrectly converts the db_load project. 21For more information, see <a href="http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q321274&">Microsoft's article about this bug</a>.</p> 22<p>The workaround is simply to switch the <b>db_load</b> project back to 23generating an EXE after converting to VC++ .NET. To do this, right 24click on db_load -> Properties and change "Configuration Type" from 25"Dynamic Library (.dll)" to "Application (.exe)".</p> 26<p><li><b>My Win* C/C++ application crashes in the Berkeley DB library when Berkeley DB calls 27fprintf (or some other standard C library function).</b> 28<p>You should be using the "Debug Multithreaded DLL" compiler option in 29your application when you link with the 30build_windows\Debug\libdb47d.lib library (this .lib file 31is actually a stub for libdb47d.DLL). To check this 32setting in Visual C++, choose the <i>Project/Settings</i> menu 33item and select <i>Code Generation</i> under the tab marked 34<i>C/C++</i>; and see the box marked <i>Use runtime 35library</i>. This should be set to <i>Debug Multithreaded DLL</i>. 36If your application is linked against the static library, 37build_windows\Debug\libdb47sd.lib; then, you will want 38to set <i>Use runtime library</i> to <i>Debug Multithreaded</i>.</p> 39<p>Setting this option incorrectly can cause multiple versions of the 40standard libraries to be linked into your application (one on behalf 41of your application, and one on behalf of the Berkeley DB library). That 42violates assumptions made by these libraries, and traps can result.</p> 43<p><li><b>Why are the build options for DB_DLL marked as "Use MFC in a Shared DLL"? 44Does Berkeley DB use MFC?</b> 45<p>Berkeley DB does not use MFC at all. It does however, call malloc and free 46and other facilities provided by the Microsoft C runtime library. We 47found in our work that many applications and libraries are built 48assuming MFC, and specifying this for Berkeley DB solves various 49interoperation issues, and guarantees that the right runtime libraries 50are selected. Note that because we do not use MFC facilities, the MFC 51library DLL is not marked as a dependency for libdb.dll, but the 52appropriate Microsoft C runtime is.</p> 53<a name="4"><!--meow--></a> 54<p><li><b>How can I build Berkeley DB for <a href="http://www.mingw.org">MinGW</a>?</b> 55<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 56configuration script. This configuration option currently only builds 57static versions of the library, it does not yet build a DLL version of 58the library.</p> 59</ol> 60<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_wince/intro.html"><img src="/images/next.gif" alt="Next"></a> 61</td></tr></table> 62<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 63</body> 64</html> 65