Troubleshooting on Windows

Compiling Errors
Linking Errors
Execution Errors

Compiling Errors

Compiling fails with the message "Error, cannot find include file windows.h" or "cannot open include file 'winres.h'".

That problem happens because the file, which is needed to compile programs that make calls to the Windows operating system, is not installed. To fix this, download and install the Microsoft Windows SDK for your system (it is free).

Once the SDK is installed, add the file paths to Visual Studio. Select Options... from the Tools pull-down menu. Choose Projects and Solutions -> VC++ Directories -> Show directories -> Include files. Add the complete path to Microsoft Platform SDK\Include\mfc and Microsoft Platform SDK\Include to the list of directories. Next select Show directories -> Library files Add the complete path to Microsoft Platform SDK\Lib to the list of directories. These instructions my vary depending on your SDK and Visual Studio version.

Linking Errors

Linking fails with the error "unsatisfied link error".

This error can have multiple causes, and can mean that the library in question is missing or not in the PATH, or that one of the dependent libraries is missing or cannot be loaded properly. A useful tool in debugging this error is the free program depends.exe.

If depends.exe shows that the missing libraries do not have a name like MSVC*.dll, and the files are on the computer, then directories containing the libraries must be added to the PATH environment variable. To do this add the directories to Control Panel -> System -> Advance -> Environment Variables.

Unable to find MSVC*.dll when linking, or program failed to execute because it could not find MSVC*.dll

If the missing files have names like MSVC*, then the situation is a bit more complicated. These are the standard template libraries of C++ and C, and they have to be linked through a manifest that is embedded in the libraries. Simply moving the libraries into the PATH will not fix the problem. This problem can have several causes and solutions.

  1. Berkeley DB XML was compiled from source on a hard drive of type FAT.

    Visual Studio has a bug were the manifest does not update properly on FAT hard drives. To fix this modify the Visual Studio projects xerces, dbxml, db, db_java, dbxml_java, and xqilla as follows: Right click the project and select Properties -> Configuration Properties -> Manifest Tool -> General and change Use FAT32 Work-around to Yes. Then rebuild all of the projects.

  2. Berkeley DB XML was compiled from source on a hard drive that is not of type FAT.

    In this case the files might not be installed on the computer. To fix this, download and install the Microsoft SDK as described in the Compile Errors section above.

  3. The Berkeley DB XML binaries are installed.

    In this case the files are installed by the binary installation, but some dependent operating system files may be missing. In that case download and install Microsoft Visual C++ 2005 or 2008 SP1 Redistributable Package (x86 or X64, depending on the system, although the binaries are all 32 bit, so the x86 version may be required even if the system is different).

Execution Errors

Running Java results in an "Internal Error" when trying to open an XmlManager or Environment.

This has been reported as being caused by the Java cache being too large (especially on 64-bit systems running Java in 32-bit mode). The solutions is to reduce the size of the Java cache to below its maximum (which has been reported as being 486 MB, although this may very with different JVM) by starting Java with the flags -Xms32m -Xmx300m.

The Berkeley DB XML binaries are installed and running the dbxml shell, or any other program, results in the error message "Program failed to initialized due to error X(######)".

Missing files cause this. To solve this download Microsoft Visual C++ 2005 (or 2008) SP1 Redistributable Package (x86 or X64, depending on the system, although the binaries are all 32 bit, so the x86 version may be required even if the system is different).

Running Java from the Berkeley DB XML binaries on 64-bit Windows

This can be done, but it requires that the 64-bit JVM be run in 32-bit mode and with the flags -Xms32m -Xmx300m. To run in 64-bit mode requires that Berkeley DB XML be compiled from source as a 64-bit library.