Error LNK2019: unresolved external symbol (from device team)

Error LNK2019: unresolved external symbol


Error LNK2019: unresolved external symbol int __cdecl CeMountDBVolEx, void * __cdecl CeOpenDatabaseInSession

You have created a C++ device project and using the EDB methods from "coredll.lib". You have included the "windbase_edb.h" file in your projects source files. When you compile and link this you are getting following linker errors


error LNK2019: unresolved external symbol "int __cdecl CeMountDBVolEx(struct _CEGUID *,wchar_t *,struct _CEVOLUMEOPTIONS *,unsigned long)" (?CeMountDBVolEx@@YAHPAU_CEGUID@@PA_WPAU_CEVOLUMEOPTIONS@@K@Z) referenced in function "int __cdecl MountDbVol(void)" (?MountDbVol@@YAHXZ)

error LNK2019: unresolved external symbol "void * __cdecl CeOpenDatabaseInSession(void *,struct _CEGUID *,unsigned long *,wchar_t *,struct _SORTORDERSPECEX *,unsigned long,struct _CENOTIFYREQUEST *)" (?CeOpenDatabaseInSession@@YAPAXPAXPAU_CEGUID@@PAKPA_WPAU_SORTORDERSPECEX@@KPAU_CENOTIFYREQUEST@@@Z)

and you are wondering why this is happening?

The problem with your project is that you are using a "C" style exported library in your C++ projects. When the compiler generates mangled names for C++ functions, they are different from unmangled names generated by the C compiler and hence the C++ compiler will not be able to link with the methods imported from coredll.lib.
The solution to this problem is - while including the header windbase_edb.h, you can explicitly tell the compiler that all functions included from this header are "C" style functions by changing your inclusion as below.


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

With this the C++ compiler when includes the declarations from the windbase_edb.h file, it does not do any name mangling for the functions declared in this file, and thus you should be able to link to EDB without any problems now.

Gangadhar Heralgi

Published Sunday, November 20, 2005 8:17 PM by vsdteam

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值