3.) Once all that is done you want to configure Visual C++ so that it will find DirectX. ( Usually this is done automatically, but not always so I'll explain anyway. )
NOTE: This is for Visual Studio 2008, for the 2010 instructions scroll down!
Open up VC++ and go to Tools -> Options, this dialog should pop up:
In the image you can see that I've highlighted some things you want to unfold.
"Executable files" is also highlighted because you need to change it.
First, change it to "Include files".
Once you've done that you should add a new line and add the "\Microsoft DirectX SDK (August 2009)\Include" directory like so:
Notice that "Include files" is selected in the top right corner and that because I have a x64 OS my program files has (x86) behind it.
If you do not have x64 OS then the DirectX SDK is located in the regular Program Files folder.
There are some other lines visible but those are not important for DirectX.
Now that we have the "Include" directories set up, we need to add the "Library" directories.
Select the "Library files" from the little drop-down list and again add a new line like so:
Notice that you need to select either the x86 directory in "Microsoft DirectX SDK (August 2009)\Lib\" or the x64.
Select the x86 folder no matter what your OS is.
( x64 is used for building 64-bit applications which you will probably not be doing )
Now there is only very important step that yet remains:
Click the OK button, don't just close the window as your settings will not be saved if you do.
For 2008; Visual C++ will now always find your DirectX SDK ( headers and libraries ).
You should be able to compile DirectX dependant code just fine now.
Right click on the project and go to properties:
Go to the Visual C++ Directories tab ( this is new in 2010 ) and add the correct libraries, scroll up to see which ones.
( They are detailed in the above pictures. ( Note that you might have the 2010 version of DirectX,
the screenshots show the 2009 version, they should both work fine )
Some hints as to how to add new lines/folders:
Unfortunately, for VS2010, you will have to do this for every project,
if anyone knows a way to get this standardised, please share
The Following 4 Users Say Thank You to Archangel For This Useful Post: