链接器错误“未解析的外部符号__stdio_common_vsprintf”,正在构建Windows内核驱动程序

问题描述

我收到链接器错误: 错误LNK2019:函数_vsnprintf_l中引用的未解析的外部符号__stdio_common_vsprintf 项目是Windows内核驱动程序。 我在我的代码中使用RtlStringCbVPrintfA和RtlStringCbPrintfA函数,它们可能使用_vsnprintf_l 如果添加ucrt.lib库,则可以进行链接,但是由于出现了对UM DLL的依赖性,因此OS无法加载驱动程序。 对于内核模式,是否可以将RtlStringCbVPrintfA和RtlStringCbPrintfA链接在一起获得代码?

解决方法

问题已解决。 用户模式以某种方式在预编译标头的源文件选项中出现了路径,并且包含了错误的标头(来自UM)

,

你需要插入这一行

#define _NO_CRT_STDIO_INLINE

以下评论 unresolved external symbol __stdio_common_vswprintf

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...