0

I have been stuck on an issue with building my driver due to a linker error. The driver has built in the past, but since then I have reset my PC and updated to Windows 10 Version 20H2. (It previously built on 1909 with no issues.)

I downloaded the latest Windows SDK + WDK from https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk (WDK for Windows 10, version 2004)

The error I get when building is:

1>Main.obj : error LNK2019: unresolved external symbol __acrt_iob_func referenced in function printf

1>Main.obj : error LNK2019: unresolved external symbol __stdio_common_vswprintf referenced in function _vswprintf_c_l

1>Main.obj : error LNK2019: unresolved external symbol __stdio_common_vfprintf referenced in function _vfprintf_l

This is triggered by using using printf and swprintf.

Just in case this matters, the main driver code is in a .cpp file, and the includes are in a .h file.

Could anyone help me figure out how to fix this? Thanks.

  • `swprintf` I can understand but `printf` in a driver is strange as there is no console attached to print to. Perhaps MS removed support for console IO from the driver libraries? – Richard Critten Jun 13 '21 at 19:41
  • I replaced printf with DbgPrint which fixed one of the issues. I tried to use RtlStringCbPrintfW instead of swprintf, but the issue still remains. Edit: I fixed this by adding "#define _NO_CRT_STDIO_INLINE". Thanks for your help. – heyguys123 Jun 13 '21 at 20:01

0 Answers0