Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved external symbol __vsnprintf .... (in dxerr.lib)?

I am running a DirectX 11 application on windows 7 and visual studio community 2015 RC. I'm still using functions from the DX SDK. It worked fine on VS2013 but when I switched over I get only the following error:

Error   LNK2019 unresolved external symbol __vsnprintf referenced in function "long __stdcall StringVPrintfWorkerA(char *,unsigned int,unsigned int *,char const *,char *)" (?StringVPrintfWorkerA@@YGJPADIPAIPBD0@Z)   Ancora  D:\Moody\Moody\Projects\Projects\Ancora\Ancora\dxerr.lib(dxerra.obj)    1

I only use the DXGetErrorDescriptionA function from the dxerr library and when I comment it out, the program compiles fine. I have no idea what's wrong but it can't be from the DX SDK or otherwise the other functions would fail right?

like image 904
Moody Avatar asked Jun 25 '15 14:06

Moody


2 Answers

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.

like image 58
LaurieW Avatar answered Oct 14 '22 23:10

LaurieW


just add

#pragma comment(lib, "legacy_stdio_definitions.lib")

https://msdn.microsoft.com/en-us/library/bb531344.aspx

like image 25
Masaki Ohashi Avatar answered Oct 14 '22 21:10

Masaki Ohashi