解决 vc6 unresolved external symbol ___security_cookie 问题

vc6使用高版本编译器生成的lib时,编译不通过:

detours.lib(detours.obj) : error LNK2001: unresolved external symbol ___security_cookie
detours.lib(disasm.obj) : error LNK2001: unresolved external symbol ___security_cookie
detours.lib(detours.obj) : error LNK2001: unresolved external symbol __except_handler4
detours.lib(detours.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
detours.lib(disasm.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4

 

加入下面代码可解决:

#if _MSC_VER < 1300 // 1200 == VC++ 6.0
extern "C"
{
 int __security_cookie = 0;     //比错误提示的名称少一个下划线
 void __fastcall __security_check_cookie(unsigned int cookie)  //参数个数要正确
 {
 }
 
 void * __cdecl _except_handler4(void *ExceptionRecord, void *EstablisherFrame, void *ContextRecord, void *DispatcherContext)
 {
  return 0;
 }


 //可根据提示继续添加....
};
#endif

 

 

 

 

 

你可能感兴趣的:(vc6编译,unresolved,external,symbol)