일부 API 기능이있는 라이브러리 (C++)가 있습니다. 그 중 하나는 __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
-이 라이브러리를 사용하지만, 위의 API를 호출하지 않거나 Func
형식을 사용하는 C++ 실행 가능한 프로젝트가 있습니다.
__stdcall
에 Func
의 호출 규칙을 변경 한 후, 나는 다음과 같은 컴파일 오류가 얻을 :
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
어떤 생각이 무엇을 할 수 있을까?
미리 감사드립니다.