1

I am getting Linker error: error LNK2019: unresolved external symbol __stdio_common_vsprintf referenced in function _vsnprintf_l Project is Windows Kernel driver. I use RtlStringCbVPrintfA and RtlStringCbPrintfA functions in my code, which probably use _vsnprintf_l If I add ucrt.lib library, linking is OK, but driver will not be loaded by OS, because dependence on UM DLL appears. Is it possible get the code with RtlStringCbVPrintfA and RtlStringCbPrintfA linked OK for Kernel Mode ?

Kola73
  • 134
  • 1
  • 7
  • Link ntstrsafe.lib. – Michael Kim Aug 20 '20 at 15:05
  • @MichaelKim, I did, but unfortunately, it did not help. I use other RtlStringCb* functions, implemented in ntstrsafe.lib, and they were linked OK. Only with RtlStringCbVPrintfA and RtlStringCbPrintfA I got this problem – Kola73 Aug 21 '20 at 20:30
  • Does this answer your question? [unresolved external symbol \_\_stdio\_common\_vswprintf](https://stackoverflow.com/questions/67740175/unresolved-external-symbol-stdio-common-vswprintf) – Vega Jun 14 '21 at 08:25

2 Answers2

0

Problem resolved. Somehow UserMode includes path appeared in precompiled header's source file options, and wrong headers (from UM) were included

Kola73
  • 134
  • 1
  • 7
  • How exactly did you resolve this? This issue appeared for me too after installing recent Visual Studio update. VC++ Directories >> Include Directories list (in the following order): `km\crt`, `km` and `shared` from `C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0`. – Simon Rozman Jun 01 '21 at 09:12
  • I have checked the include paths in the project and found that UM path was included. – Kola73 Jun 02 '21 at 12:15
  • Kola73, thanks. I thought I am missing something. Fortunately within a day or so, https://stackoverflow.com/a/67745800/2071884 came in and proved to resolve my linking issue. – Simon Rozman Jun 04 '21 at 02:46
0

This question was duplicated. unresolved external symbol __stdio_common_vswprintf

  • Comment? You mean answer? When you come across a duplicate question, please flag as such instead of answering with a link – Vega Jun 14 '21 at 08:26