mobile数据库遇到的问题

今天在加数据库的相关操作时,遇到了一些问题,提示

error C3861: 'CeMountDBVolEx': identifier not found
error C3861: 'CeMountDBVolEx': identifier not found
error C3861: 'CeCreateDatabaseWithProps': identifier not found
error C3861: 'CeCreateSession': identifier not found
error C3861: 'CeOpenDatabaseInSession': identifier not found

我在.cpp文件的开头加入了

#define EDB
#include <windows.h>
#include <windbase.h>

但是错误还依然存在

从网上搜索了一些方法

在博文《mobile数据库遇到的问题》

http://blog.sina.com.cn/s/blog_4c5ad0740100cvxg.html

它里面建议使用

extern "C"
{
  #include <windbase_edb.h>
}

但是使用后,问题变成了lnk的错误

error LNK2019: unresolved external symbol

有人在论坛里建议

#include Windbase_edb.h

也是同样的问题

最后,我问了一下我的同事

他建议我在

stdafx.h 头文件中添加

#define EDB
#include <windows.h>
#include <windbase.h>

这样的确解决了问题。

 

 

posted @ 2009-02-04 13:16  sandyqy  阅读(222)  评论(0编辑  收藏  举报