我有一个使用平台工具集 WindowsKernelModeDirver8.1 的 KMD。 驱动程序编译链接,使用 VS 2013 运行没有任何问题。 我正在运行 Windows 10。
当我尝试使用 VS 2015 编译它时,出现以下链接错误。
1>链接:错误 LNK2001:未解析的外部符号 GsDriverEntry 1>terVertaPci.obj : error LNK2019: 未解析的外部符号 __security_check_cookie 在函数 terVertaPciDevCtl 中引用 1>ntoskrnl.lib(gshandler.obj) : error LNK2001: 未解析的外部符号 __security_check_cookie 1>terVertaPci.obj : error LNK2019: 未解析的外部符号 __security_cookie 在函数 terVertaPciDevCtl 中引用
我在我的 C++ 代码中的任何地方都找不到对未解析符号的引用。 看起来 VS 2015 链接在与 VS 2013 不同的库中,但是 我找不到有关差异的任何信息。我的组织有 宣布 VS 2015 为新标准,这就是我遇到此问题的原因。
我是处理 KMD 代码的新手。任何帮助将不胜感激。
第一次在VS 2015打开解决方案时,提示需要升级VC++编译器和库,但是自动升级的结果是:
Configuration 'Win7 Debug|x64': no upgrade required. Platform Toolset is 'WindowsKernelModeDriver8.1'.
Configuration 'Win7 Release|x64': no upgrade required. Platform Toolset is 'WindowsKernelModeDriver8.1'.
TargetFrameworkVersion = v4.5 (was v4.5)
重定向结束:1个完成,0个失败,0个跳过
最佳答案
Visual Studio 2015 仅适用于 Windows 10 版本 1703 的 WDK。 它甚至不适用于 WindowsKernelModeDriver 8.1 虽然 8.1 是 PlatformToolset 中的一个选项。
VS 2015 升级工具显示“无需升级”时不正确
安装适用于 Windows 10 版本 1703 的 WDK 并设置 PlatformToolset 因为 WindowsKernelModeDriver 10.0 解决了这个问题。
关于c++ - 内核模式驱动程序不会在 VS 2015 中链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48707236/