I am learning Direct3D from directxtutorial.com. I am including it through a preprocessor directive in the code below.
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "d3dx11.lib")
#pragma comment(lib, "d3dx10.lib")
This is not doing it, however. I am guessing it is because the library files aren't where its checking to find them. But could someone explain what's going on here? Thanks. The error message is: "Intellisense: could not open source file"
You'll need to download and install the Windows SDK from this link.
Next, you'll need to configure your solution in Visual Studio to look for the appropriate files. This may be broken down in to two categories: Adding the include paths and Linking the libraries. Please take note of your Windows SDK directory. On my system, it is
C:\Program Files (x86)\Microsoft SDKs\Windows\7.0A\
.Adding include paths
Visual Studio comes pre-packed with a subset of the DirectX header
.h
files, but the complete collection is available inWindowsSDKPath\Include
.Add this path to your project's additional includes:
Solution Explorer
, and chooseProperties
from the menu:All Configurations
.Configuration Properties | C/C++ | General
. This option will only appear if you have at least one.c
or.cpp
file in your project.Additional Include Directories
box, add the path to your Windows SDK Includes, for example:C:\Program Files (x86)\Microsoft SDKs\Windows\7.0A\Include
.#include <d3d11.h>
.Linking the libraries
The Direct 3D libraries are contained in the
WindowsSDKPath\Lib
folder.Configuration Properties | Linker | Input
.Additional Dependencies
field, chooseEdit...
Your project should now be configured to build Direct 3D Applications.