Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/145.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 使用常量成员方法导出类_C++_Constants_Dllexport - Fatal编程技术网

C++ 使用常量成员方法导出类

C++ 使用常量成员方法导出类,c++,constants,dllexport,C++,Constants,Dllexport,当我在Visual Studio中导出具有const成员函数的类时,运行用户应用程序会导致此函数的运行时错误“未找到入口点” //header file class EXPORT_API A { //... void foo() const; //... } //cpp file void A::foo() const { //... } 有趣的音符。Demanling“missing”函数(从Dependency Walker复制并使用demangler.com取消修饰)如

当我在Visual Studio中导出具有
const
成员函数的类时,运行用户应用程序会导致此函数的运行时错误“未找到入口点”

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

//cpp file
void A::foo() const
{
  //...
}
有趣的音符。Demanling“missing”函数(从Dependency Walker复制并使用demangler.com取消修饰)如下所示:

public:void\uu cdecl A::foo(void)const\uu ptr64

,但当我在Dependency Walker中“取消装饰”相同的函数时,常量限定符消失了

但是,如果我删除
const
说明符,一切都会正常工作


为什么会发生这种情况,以及如何导出包含
const
成员的类?

您使用的是哪种平台?Windows,Visual Studio?您是否尝试重新编译所有内容?是否查看了?@amchacon是的,我尝试从头开始重新编译所有内容,而不使用const-all。然后用const重复-失败