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:
- About adding legacy to linker additional dependencies_ stdio_ definitions.lib Solve the problem of incomplete standard library files
- Common compatibility problems of VS2010 to vs2017 projects
- Vs compiling OpenGL project, the solution of unable to open the source file “GL / glaux. H” appears
- Visual studio 2019 + OpenGL environment configuration
- Write about the problems and solutions when configuring OpenGL in vs2015
- Visual Studio Tips: error LNK2005: … already defined in LIBCMTD.lib(new.obj)
- OpenGL application cannot start normally
- The solution of configuring OpenGL in vs2017
- Summary of problems encountered in compiling opengl code
- Vs2013 compiling ffmpeg
- Debug assembler NTVDM has encountered a system error The equipment connected to the system does not work
- fatal error LNK1120: 1 unresolved externals
- Vs2019 nuget configuring OpenGL
- Configuring OpenGL development environment in win10 + vs2015 (including the method of installing 32-bit and 64 bit libraries)
- An error occurred during the installation of assembly
- How to Fix Fatal Error lnk1120: 1 unresolved externals
- GCC forces all symbols in the link library
- LINK : error LNK2001: unresolved external symbol _mainCRTStartup
- The language of C__ FILE__ 、__ LINE__ And line
- clang: error: linker command failed with exit code 1 (use -v to see invocation)