gpt4 book ai didi

c++ - ESP 的值未在函数调用中正确保存

转载 作者:行者123 更新时间:2023-11-30 01:58:25 25 4
gpt4 key购买 nike

我正在从事 Visual Studio 项目项目 A(在编译时生成静态库)

有课

using namespace mynamespace;
class projectAclass
{
virtual int funct1()=0; //Pure virtual function
virtual int funct2()=0; //Pure virtual function
virtual int funct3()=0; //Pure virtual function
};

项目 B(在编译时生成 DLL)

#define projectBclass_DLL __declspec( dllexport )
class projectBclass_DLL projectBclass: public mynamespace::projectAclass
{
//Definitions of the 3 pure virtual functions are here
int funct1()
{
//definition go here
}
//similarly for funct2 and funct3

int funct4()
{ //Definition goes here }
int funct5()
{ //Definition goes here }
int funct6()
{ //Definition goes here }
};

现在从在其他一些项目中创建的主函数我创建了一个类 projectAclass 的对象并尝试调用函数 funct1 但我不知道其他一些函数当我尝试调试解决方案并且从 funct4 返回后我收到此错误

Run-Time Check Failure #0 - The value of ESP was not properly saved across a
function call. This is usually a result of calling a function declared with
one calling convention with a function pointer declared with a different calling
convention.

提前致谢

最佳答案

有时你有 calling conventions错误的。有时重建一切都会对其进行排序。

关于c++ - ESP 的值未在函数调用中正确保存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17446089/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com