我有一个库(C++),它有一些 API 函数。其中之一被声明为 __cdecl,但从 __stdcall 获得一个函数指针。就像是:
typedef int (__stdcall *Func)(unsigned char* buffer);
//...
int ApiFunc(Func funcPtr); //This is __cdecl since it is an 'extern "C"' library and the calling convention is not specified
然后 - 我有一个使用此库的 C++ 可执行项目,但不调用上述 API 或使用该Func
类型。
Func
更改to的调用约定后__stdcall
,出现以下编译错误:
错误 C2995: 'std::pointer_to_unary_function<_Arg,_Result,_Result(__cdecl *)(_Arg)> std::ptr_fun(_Result (__cdecl *)(_Arg))' : 函数模板已定义 c:\program files\微软视觉工作室 8\vc\include\functional
知道会是什么吗?
提前致谢!!