vc6 unresolved external symbol ___security_cookie

来源:互联网 发布:软件实施的流程 编辑:程序博客网 时间:2024/05/16 10:11
 

解决 vc6 unresolved external symbol ___security_cookie 问题

分类: vc6编译 unresolved external symbol ___security_cookie 912人阅读 评论(0) 收藏 举报

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

原创粉丝点击