I downloaded berkeley-db 4.4.20 windows ims installed file,installed it
on my windows 2003 server os.
In visual studio .net 2003 I created a test mfc project to use the DB
library.
add include directory

:\Program Files\Sleepycat Software\Berkeley DB
4.4.20\include
add lib directory

:\Program Files\Sleepycat Software\Berkeley DB
4.4.20\lib
add lib dependency:libdb44.lib
add D:\Program Files\Sleepycat Software\Berkeley DB 4.4.20\bin to PATH
environment variable.
In the test project I write code like this
Db db(NULL,0);
u_int32_t oFlags = DB_CREATE;
try
{
db.open(NULL,
"my_db.db",
NULL,
DB_BTREE,
oFlags,
0);
db.close(0);
}
catch(DbException &dbe)
{
}
catch(std::exception &e)
{
}
The test project works well, and a my_db.db file was created.
But when I do the same in Visual Studio 2005 ,the test project even
can't get complied,throw error like this:
1>d:\program files\sleepycat software\berkeley db
4.4.20\db-4.4.20\build_win32\db.h(1206) : error C2143: syntax error :
missing '}' before '('
double click the error ,visual studio points to db.h at:
typedef enum {
DB_BTREE=1,
DB_HASH=2,
DB_RECNO=3,
DB_QUEUE=4,
DB_UNKNOWN=5 /* Figure it out on open. */
} DBTYPE;
And when I use Visual studio .net 2005 to build from source ,It can't
work according to the build manual.
Anybody knows why?