我正在开发一个 Visual Studio 项目 Project 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但我不知道在我尝试时正在调用 projectBclass 中定义的其他函数(比如说 funct4)调试解决方案,从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.
提前致谢