Note: The following error was encountered while compiling DirectX provided sample on VS2015
LNK2001 __vsnwprintf SimpleSample11 C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\Direct3D11\SimpleSample11\ DxErr. Lib (dxErr.obj)
Some of the information found on the Internet is summarized as follows
The solution
Add the following compile preprocessor instruction to the source file that reported the error
#pragma comment(lib, "legacy_stdio_definitions.lib")
Error reason
The VS2015 design changed many of the original libraries to inline, and inline functions are not visible to DLLs or LIBs, so there is no library file to link to, so we have to add a special library file to link to the library functions, namely legacy_stdio_defines.lib. There are many Windows 8 SDKs that rely on these methods that have been inlined in the new runtime, and so far it seems that using legacy_stdio_defines.lib can remedy most of the problems left over from this change. According to Microsoft, they will update the Windows SDK in the final VS2015 release to resolve this issue.
Refer to the address
- (VS 2015 CTP 5 C++) _vsnwprintf_s and other functions are not exported in appcrt140.dll, breaking linkage of static libraries C++: Unresolved external symbol _sprintf and _sscanf in Visual Studio 2015missing (stdio) identifiers with external linkage
Read More:
- Vs error unresolved external symbol_ Main, the symbol in the function “int”__ cdecl invoke_ main
- Error LNK2019: unresolved external symbol_ Main the symbol is in the function___ Tmaincrtstartup
- error LNK2019: Unresolved external symbol-resolution record
- LINK : error LNK2001: unresolved external symbol _mainCRTStartup
- LNK2001: unresolved external symbol maincrtstartup
- Vs compiling OpenGL project, the solution of unable to open the source file “GL / glaux. H” appears
- Small problems encountered in compiling OpenGL under VS2010
- Summary of problems encountered in compiling and installing vtk7 + vs2013 / 2015 + cmake
- Compiling QT project under vs encountered “error 89error msb6006:“ cmd.exe ”Exited with code 3
- Solution for Error Code: s1023 when installing DirectX SDK
- Solution of error msb3073 when compiling with vs
- [OpenGL · error] visual studio 2019 reports an error. It is an external symbol gladloadglloader that cannot be parsed. This symbol is referenced in the function main
- Vs2013 compiling ffmpeg
- Error lnk1120: 2 unresolved external commands: vtkrenderingopengl_ Autoinit (construct, destroy), which is referenced in
- Vs2015 compiling ffmpeg source code
- Vs (Visual Studio) encountered a solution that could not open iostream
- Summary of problems encountered in compiling opengl code
- LNK2019 failed to parse external symbol error
- The reason of OpenGL configuration error in VS