我有一个库(C++),它有一些API函数。其中之一被声明为__cdecl,但是从__stdcall获取函数poiner。喜欢的东西:混合调用约定编译错误
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
然后 - 我有一个使用这个库,但不调用上述API或使用Func
类型C++可执行项目。
改变Func
调用约定到__stdcall
后,我得到以下编译错误:
error C2995: 'std::pointer_to_unary_function<_Arg,_Result,_Result(__cdecl *)(_Arg)> std::ptr_fun(_Result (__cdecl *)(_Arg))' : function template has already been defined c:\program files\microsoft visual studio 8\vc\include\functional
任何想法可能是什么?
在此先感谢!