VS2010 在编译一个驱动时出现无法解析的外部符号 的解决方法

今天在用VS2010编译一个驱动时出现 :

1>MSVCRT.LIB(gs_report.obj) : error LNK2019: 无法解析的外部符号 __imp__TerminateProcess@8,该符号在函数 ___report_gsfailure 中被引用     1>MSVCRT.LIB(gs_report.obj) : error LNK2019: 无法解析的外部符号 __imp__GetCurrentProcess@0,该符号在函数 ___report_gsfailure 中被引用     1>MSVCRT.LIB(gs_report.obj) : error LNK2019: 无法解析的外部符号 __imp__UnhandledExceptionFilter@4,该符号在函数 ___report_gsfailure 中被引用     1>MSVCRT.LIB(gs_report.obj) : error LNK2019: 无法解析的外部符号 __imp__SetUnhandledExceptionFilter@4,该符号在函数 ___report_gsfailure 中被引用     1>MSVCRT.LIB(gs_report.obj) : error LNK2019: 无法解析的外部符号 __imp__IsDebuggerPresent@0,该符号在函数 ___report_gsfailure 中被引用


从上面看是引用的MSVCRT.LIB出现冲突,于是把VS2010里链接器 下面的 附加依赖库 中的 MSVCRT.LIB 去掉后编译出现如下错误:

1>wdmsec.lib(chandler4.obj) : error LNK2019: 无法解析的外部符号 @__security_check_cookie@4,该符号在函数 _ValidateLocalCookies 中被引用
1>wdmsec.lib(exsup4.obj) : error LNK2001: 无法解析的外部符号 @__security_check_cookie@4

采用WDK编译 发现编译正常,经对比WDK编译生成的LOG文件,发现调用了BufferOverflowK.lib 和sehupd.lib 这个库,把这两个库加到附加依赖库里再次编译,没有出再无法解析的外部符号.

posted @ 2014-10-29 20:14  钰清山人  阅读(30)  评论(0编辑  收藏  举报  来源