Exporting class with const member methods

When I export a class with const member function in Visual Studio, running the user application results in a run-time error "Entry Point Not Found" for this function...

//header file
class EXPORT_API A
{
  //...
  void foo() const;
  //...
}

//cpp file
void A::foo() const
{
  //...
}

Interesting note. Demangling the "missing" function (copied from Dependency Walker and undecorated with demangler.com) looks like:

public: void __cdecl A::foo(void)const __ptr64

, but when I "undecorate" the same function in Dependency Walker itself, const qualifier disappears...

However, everything works if I remove const specifier.

Why is this happening and how to export classes with const members?

链接地址: http://www.djcxy.com/p/94580.html

上一篇: libclang:如何获取令牌语义

下一篇: 用const成员方法导出类