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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With