我有一個庫(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
任何想法可能是什麼?
在此先感謝!