# Error LNK2019 unresolved external symbol __vsnprintf … (in dxerr.lib)

1>------ 已启动生成: 项目: XuglassForm, 配置: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1188,5): warning MSB8012: TargetPath(C:\Users\hxy-pc\Desktop\XuglassForm\Debug\XuglassForm.exe) does not match the Linker's OutputFile property value (). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir),$(TargetName) and \$(TargetExt) property values match the value specified in %(Link.OutputFile).
1>odbccp32.lib(dllload.obj) : error LNK2019: 无法解析的外部符号 __vsnwprintf_s，该符号在函数 _StringCchPrintfW 中被引用
1>XuglassForm.exe : fatal error LNK1120: 1 个无法解析的外部命令
========== 生成: 成功 0 个，失败 1 个，最新 0 个，跳过 0 个 ==========

http://stackoverflow.com/questions/32418766/c-unresolved-external-symbol-sprintf-and-sscanf-in-visual-studio-2015

1）在vs2015安装文件夹Lib文件放入odbccp32.lib文件
2）打开编译文件，项目\属性\连接器\输入\附加依赖里面输入
D:\Program Files (x86)\Microsoft Visual Studio 14.0\lib\odbccp32.lib

#include <Windows.h>
#include <stdio.h>
int (WINAPIV * __vsnprintf)(char *, size_t, const char*, va_list) = _vsnprintf;


The legacy DirectX SDK is quite old, and dxerr.lib in the DXSDK is not compatible with VS 2015's C Runtime as you have encountered.
In general static libraries with code in them don't mix well from different versions of the compiler. Most of the .libs in the legacy DirectX SDK work with VS 2015 because they are import libraries for dlls or all data libraries and therefore contain no code at all. The DXSDK has not been updated since VS 2010.
Be sure to read the instructions on MSDN on the proper way to mix the legacy DirectX SDK with the Windows 8.x SDK used by VS 2015. You are presumably using something else from the legacy DirectX SDK in this project besides dxerr.
I have implemented a version of DXERR that you can build from source in your project to remove this dependacy of the legacy DirectX SDK. See this post for details. That said, I purposely only supported Unicode (the W version). You can work out how to make the ANSI (the A version) easily enough, but it would be best if updated your app to use Unicode.
DirectX SDK版本库过老，不符合VS2015的编译gui'ze

HACKY but you could patch dxerr.lib.
Replace __vsnprintf with _vsnprintf (with a null at the end to account for the removed underscore at the beginning)

You can change the Platform Toolset from Visual Studio 2015 to Visual Studio 2013 and then it compiles. The Platform Toolset is found on the General tab of the Project Properties.

The DirectX libraries you are using are compiled with an older version of Visual Studio than you are using. Microsoft sometimes makes changes to their C runtime, creating incompatibilities between libraries compiled with different versions. __vsnprintf was an internal symbol in older versions of their C runtime, it does not exist in the 2015 RC version.
Unfortunately, dxerr.lib (along with d3dx11.lib) have been deprecated. You have two options - you can switch back to VS2013 or you can stop using functionality from dxerr.lib. The latter is probably better, because you can duplicate its functionality by using FormatMessage now (more info in the linked article).
dxerr.lib和d3dx11.lib已经被弃用

I experienced the same problem using DXGetErrorMessage() with Dx9 and found out that MS have provided an additional library to include in the Additional Dependencies properties page to address this problem. The library name is: legacy_stdio_definitions.lib
Adding this resolved the issue for me.

DXGetErrorMessage()Dx9和发现的MS提供了一个附加的库中，以包括Additional Dependencies属性页来解决这个问题。库名称是：legacy_stdio_definitions.lib添加此解决了这个问题对我来说。

#### vs2015打开VS2010的工程时，无法解析的外部符号 __imp___vsnprintf

2016-04-08 11:42:43

#### 解决Error LNK2019: unresolved external symbol

2016-09-15 13:53:24

#### VC6.0 unresolved external symbol _snprintf

2014-06-24 09:45:33

#### error LNK2019: 无法解析的外部符号 __vsnwprintf_s

2017-07-16 10:37:16

#### 关于ERROR LNK 2005错误

2010-04-30 21:30:00

#### 设计不好的代码伤不起啊

2011-10-10 09:54:13

#### 推荐一本被忽视的书

2005-06-20 01:04:00

#### 久违了的Debian

2007-11-17 04:21:00

#### OpenGL和D3D中Cubemap的图象方向问题

2006-11-20 13:10:00

#### 字节对齐问题 --- 莫名其妙的crash

2010-12-10 14:01:00