Skip to content

Instantly share code, notes, and snippets.

@nganphant
Last active October 18, 2021 04:56
Show Gist options
  • Select an option

  • Save nganphant/c5dd662b430c8c7a15ef3f59549e1b8a to your computer and use it in GitHub Desktop.

Select an option

Save nganphant/c5dd662b430c8c7a15ef3f59549e1b8a to your computer and use it in GitHub Desktop.
Created with Copy to Gist
unresolved external symbol __vsnwprintf_s referenced in function
There were a number of breaking changes in VS2015 documented here:
https://msdn.microsoft.com/en-us/library/bb531344.aspx
In particular, for undefined   __vsnwprintf_s
"The printf and scanf family of functions are now defined inline.                    
The definitions of all of the printf and scanf functions have been moved inline into <stdio.h>, <conio.h>, and other CRT headers. This is a breaking change that leads to a linker error (LNK2019, unresolved external symbol) for any programs that declared these functions locally without including the appropriate CRT headers. If possible, you should update the code to include the CRT headers (that is, add #include <stdio.h>) and the inline functions, but if you do not want to modify your code to include these header files, an alternative solution is to add an additional library to your linker input, legacy_stdio_definitions.lib.
To add this library to your linker input in the IDE, open the context menu for the project node, choose Properties, then in the Project Properties dialog box, choose Linker, and edit the Linker Input to add legacy_stdio_definitions.lib to the semi-colon-separated list."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment