Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unresolved external symbol __stdio_common_vswprintf

I'm compiling a kernel mode driver that uses the Microsoft Dmf framework (DmfK.lib)

After the last Visual Studio update some strange linker errors appeared :

EmulationTargetPDO.obj : error LNK2019: unresolved external symbol __stdio_common_vswprintf referenced in function _vsnwprintf_l
Utilities.lib(savedata.obj) : error LNK2001: unresolved external symbol __stdio_common_vswprintf
DmfK.lib(DmfUtility.obj) : error LNK2001: unresolved external symbol __stdio_common_vswprintf
EmulationTargetPDO.obj : error LNK2019: unresolved external symbol __stdio_common_vsprintf referenced in function _vsnprintf_l
DmfK.lib(DmfCore.obj) : error LNK2001: unresolved external symbol __stdio_common_vsprintf
DmfK.lib(Dmf_CrashDump.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf_s referenced in function _vsprintf_s_l

Here's the software and kits versions I use (shown in VS "About" windows):

  • Microsoft Visual Studio Professional 2019 Version 16.10.0
  • Windows SDK 10.0.19041.685
  • Windows Driver Kit 10.0.19030.1000

The second strange thing is that I've downloaded and installed the WDK 10.0.19041.685 but VS still displays 10.0.19030.1000 ...

A similar problem can be found here : Linker error when compiling windows kernel mode driver x64 but it hasn't been solved.

like image 430
SamT Avatar asked May 28 '21 13:05

SamT


1 Answers

Set this define before including any headers:

#define _NO_CRT_STDIO_INLINE

or add it to the compiler's command line:

-D_NO_CRT_STDIO_INLINE

We (Microsoft driver team) are looking into this issue to see about removing the need for such a workaround.

like image 199
Jeffrey Tippet Avatar answered Sep 24 '22 17:09

Jeffrey Tippet