D3DX is not considered the canonical API for using Direct3D in Windows 8 and later and therefore isn't included with the corresponding Windows SDK. Investigate alternate solutions for working with the Direct3D API. For legacy projects, such as the Windows 7 (and earlier) DirectX SDK samples, the following steps are necessary to build applications with D3DX using the DirectX SDK:
一、在https://www.microsoft.com/en-us/download/details.aspx?id=6812下载DirectX SDK,然后运行安装。
二、设置环境变量DXSDK_DIR=C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)
三、在Visual Studio 2015中右键工程名,选择属性->VC++目录
1,选择“所有配置”,“所有平台”下拉选项
2,设置“包含目录”为“$(IncludePath);$(DXSDK_DIR)\Include;","库目录”为“$(LibraryPath);$(DXSDK_DIR)\Lib\x86;",点击”应用“
3,选择平台为“x64”,库目录设置为“$(LibraryPath);$(DXSDK_LIB)\Lib\x64;",点击"应用”
另外任何用到d3dx11.h的地方,必须显式地包含d3d11.h和dxgi.h,以确保你使用的是最新版本。移除DXGIType.h,因为其已经不存在于Windows SDK,DirectX SDK版本与最新的winerror.h冲突。