d3dx11.h missing? [英] d3dx11.h missing?
问题描述
所以我重新安装了directx11几次,甚至去了微软网站,并得到了SDK包,其中包含所有的直接x机柜文件。任何人有任何想法,为什么我继续得到这个错误呢?我知道为什么它会说,但更多的寻找解决方案。
1> c:\users\vaughn\ documents \visual studio
2010 \projects\myfirstapp\myfirstapp\main.cpp(5):致命错误C1083:
无法打开包含文件:'d3dx11.h':没有这样的文件或目录
这是你需要做的VS 2010在VS 2008和更早):
转到您的项目的属性|配置属性| VC ++目录。通过向DirectX头文件添加路径来编辑包含目录的行。对于2010年6月的SDK它可能类似:
32位Win:C:\Program Files \Microsoft DirectX SDK(2010年6月)\Include
64位Win:C:\Program Files(x86)\ Microsoft DirectX SDK(2010年6月)\Include
接下来你最有可能得到一个链接器的错误(缺少.lib文件)。只是去你的项目的属性|配置属性 VC ++目录,但这次编辑库目录并添加到以下路径之一:
32位Win:C:\Program Files \Microsoft DirectX SDK 2010年6月)\Lib \x86
64位Win:C:\Program Files(x86)\Microsoft DirectX SDK(2010年6月)\Lib\\ \\ x64
如果您安装了其他版本的SDK,或者将其安装到非默认目录,则相应地更改路径。还要确保你添加了d3d11.lib(也可能是d3dx11.lib)到Linker |其他依赖关系。
一般规则是,任何时候你#include<>文件,IDE需要知道在哪里找到它们。 VC ++目录是在Visual Studio中这样做的一种方式。但是只包含头文件(在大多数情况下)不够 - 你需要告诉你的链接器在哪里寻找那些头文件描述的预编译的二进制文件。通过将第二个路径添加到库目录,您可以做到。
So I've reinstalled directx11 a couple times and even went to the Microsoft website and got the SDK pack that has all the direct x cabinet files in it. Anyone have any idea why i keep getting this error then? I know why it is saying it but more looking for the solution to it.
1>c:\users\vaughn\documents\visual studio 2010\projects\myfirstapp\myfirstapp\main.cpp(5): fatal error C1083: Cannot open include file: 'd3dx11.h': No such file or directory
That's what you need to do in VS 2010 (it looks a bit different in VS 2008 and earlier):
Go to your project's properties | Configuration Properties | VC++ Directories. Edit line called Include Directories by adding path to DirectX header files. As for June 2010 SDK it may be something like:
32 bit Win: C:\Program Files\Microsoft DirectX SDK (June 2010)\Include
64 bit Win: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include
Next you are most likely to get a linker's error (missing .lib files). Just go to your project's properties | Configuration Properties | VC++ Directories again, but this time edit Library Directories and add to one of the following paths:
32 bit Win: C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86
64 bit Win: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x64
If you installed other version of SDK or installed it to non-default directory change given paths accordingly. Also make sure you added d3d11.lib (and maybe d3dx11.lib as well) to Linker | Additional Dependencies.
General rule is that any time you #include <> files your IDE needs to know where to find them. VC++ Directories is one way of doing that in Visual Studio. But sole inclusion of headers is (in most cases) not enough - you need to tell your linker where to look for precompiled binaries described by those headers. That what you do by adding the second path to Library Directories.
这篇关于d3dx11.h missing?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!