简体   繁体   English

DirectX11版本VS 2010 C ++

[英]DirectX11 release VS 2010 C++

I compiled my code in VS C++ 2010. If I use debug version, everything is okay! 我在VS C ++ 2010中编译了代码。如果使用调试版本,则一切正常! If I want to make release version, I've got communicat: 如果要发布版本,请与我交流:

main.cpp(7): fatal error C1083: Cannot open include file: 'd3dx11.h': No such file or directory main.cpp(7):致命错误C1083:无法打开包含文件:'d3dx11.h':没有此类文件或目录

I use DirectX 11. What should I do? 我使用DirectX11。该怎么办?

As noted on MSDN , all versions of D3DX are deprecated including D3DX9, D3DX10, and D3DX11. MSDN上所述 ,不推荐使用所有版本的D3DX,包括D3DX9,D3DX10和D3DX11。 You can certainly continue to use the deprecated libraries by using the legacy DirectX SDK. 当然,您可以使用旧版DirectX SDK继续使用不推荐使用的库。 Remember that with VS 2010, you have to manually add the include/lib paths to your VC++ Directories properties page of your project to use the DirectX SDK with it. 请记住,在VS 2010中,必须将include / lib路径手动添加到项目的VC ++目录属性页面,才能将DirectX SDK与它一起使用。

For 32-bit Win32 configurations: 对于32位Win32配置:

$(DXSDK_DIR)Utilities\bin\x86;$(ExecutablePath)
$(DXSDK_DIR)Include;$(IncludePath)
$(DXSDK_DIR)Lib\x86;$(LibraryPath)

For x64 native configurations: 对于x64本机配置:

$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86;$(ExecutablePath)
$(DXSDK_DIR)Include;$(IncludePath)
$(DXSDK_DIR)Lib\x64;$(LibraryPath)

If you were able to get #include <d3dx11.h> to work for DEBUG builds, but not RELEASE, you probably failed to set the VC++ Directories for All Configurations / All Platforms. 如果您能够获得#include <d3dx11.h>来运行DEBUG构建,但不能发布,则可能无法为所有配置/所有平台设置VC ++目录。

Another option would instead be to move to VS 2012 or VS 2013 which includes the Windows 8.x SDK which has the DirectX SDK integrated into it. 相反,另一种选择是迁移到VS 2012或VS 2013,其中包括集成了DirectX SDK的Windows 8.x SDK。 There you'd make use of DirectX Tool Kit , DirectXTex , DirectXMesh , and/or other replacements for legacy D3DX. 在那里,您将使用DirectX Tool KitDirectXTexDirectXMesh和/或其他D3DX的替代品

Note if you were making use of the legacy DirectX SDK to continue to use D3DX11 and were also using the Windows 8.x SDK (such as with VS 2012 or VS 2013), then you'd have to reverse the include order above because the legacy DirectX SDK headers are older than the ones in the Windows 8.x SDK. 请注意,如果您要使用旧版DirectX SDK继续使用D3DX11,并且还使用Windows 8.x SDK(例如VS 2012或VS 2013),则必须颠倒上述包含顺序,因为旧版DirectX SDK头早于Windows 8.x SDK中的头。

$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x86
$(IncludePath);$(DXSDK_DIR)Include
$(LibraryPath);$(DXSDK_DIR)Lib\x86

For x64 native configurations: 对于x64本机配置:

$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86
$(IncludePath);$(DXSDK_DIR)Include
$(LibraryPath);$(DXSDK_DIR)Lib\x64

Note you can get the Windows 8.1 SDK and DirectX Tool Kit to work with VS 2010 as noted here , but if you can I'd highly recommend using the VS 2013 Community edition if you don't have the budget for VS 2013 Professional or better. 注意:您可以获取Windows 8.1 SDK和DirectX工具包作为注意到VS 2010的工作在这里 ,但如果你能我会强烈建议使用VS 2013社区版 ,如果你没有预算VS 2013专业版或更高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM