One of the little utility libraries in the DirectX SDK is a static library for converting HRESULTs to text strings for debugging and diagnostics known as
DXERR.LIB. There were once even older versions of this library,
DXERR9.LIB, but they were removed from the DirectX SDK many years back in favor of a unified
DXERR.LIB. The DirectX Error Lookup Utility is nothing more than a little front-end UI tool for getting results from
For the Windows SDK 8.0 this library was not brought forward (see "Where is the DirectX SDK?"). This is primarily because HRESULTS for DirectX graphics APIs were added to the FormatMessage function when using
FORMAT_MESSAGE_FROM_SYSTEM in Windows 8 which already supports most of the system error codes reported by DXERR. The DirectX SDK version of
DXERR.LIB also contained a lot of error codes for legacy components that are no longer relevant to development using the Windows SDK 8.0.
DXERR.LIB contained the following functions (both ASCII and UNICODE):
And the macros
DXTRACE_MSG, DXTRACE_ERR, DXTRACE_ERR_MSGBOX
If you are still using legacy components like D3DX, DXUT, etc. from the DirectX SDK then you can continue to link to the legacy version of
DXERR.LIB as well. For those wanting to get away from dependancies on the DirectX SDK as we've recommended, I've attached a streamlined version of the library to this post. It only supports UNICODE and I had to change
DXGetErrorDescription to copy the result to a buffer rather than return a static string in order to make use of
FormatMessage where possible, but otherwise it should serve much the same purpose. You can modify it to suit your needs a well.
FORMAT_MESSAGE_ALLOCATE_BUFFER is not supported for Windows Store apps because it makes use of
The source code for this package is bound to the Microsoft Public License (Ms-PL).
While we are on the topic of utility libraries, the
DXGUID.LIB static library is also present in the Windows SDK 8.0 with the Direct3D 11.1, Direct2D, DirectWrite, and WIC GUIDs added; and the XACT and XAUDIO2 GUIDs removed. There's nothing particular special about
DXGUID.LIB because you could easily define the GUIDs using
#define INITGUID before including the relevant headers in one (and only one) module of your program yourself, but it is very convenient not to have to do that.
DXTraceW now takes
__FILEW__ along with some /analyze and /W4 cleanup, support for
WINAPI_FAMILY macros; define NOMINMAX; some fixes for VS 2015 printf string portability, package updated on November 9, 2015.
DXUT: This DXERR is included in the DXUT for Win32 Desktop Update
VS 2015: The VS 2015 C Runtime is not compatible with the
DXERR.LIB that ships in the legacy DirectX SDK. You will get link errors trying to use it. You can use this module to replace DXERR LIB but will have to rebuild the code that uses it. You can try linking with
legacy_stdio_definitions.lib instead, but ideally you'd remove this dependency on the legacy DirectX SDK.