Please help i get an error while compilling 1>sdk.cpp(6): fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory
I am new to directx so please help.
My program include files look like:
#include <StdAfx.h>
#include <windows.h>
#include <windowsx.h>
#include <d3d9.h>
#include <d3dx9.h>
And #include <d3dx9.h> is underlined with red curved line.Please help.
Thanks in advance.

You'll want to go to "Project" then "Properties" then "VC++ Directories". You'll want to add the "include" folder and the "lib" folder to the top of the "include directories" and "library directories" from the direct x SDK installation directory. The 'lib' folder you'll most likely be interested in will be the x86 subdirectory of the lib folder. In summary, you'll probably have these directories added:

Oh, and I forgot you'll probably need to inform the compiler of which .lib files you want to link against. You do this at "project", "properties", "linker->input", and "additional dependencies". Then you'll need to mention all the .lib files you are using, probably D3dx9.lib and D3d9.lib

Go to ProjectProperties -> Linker->Input->addional dependencies and include d3dx9.lib

If you get to same error again then check directx path in Visual Studio.Refer to this link for detailed information on setting up directx with vc++ - http://www.uc-forum.com/forum/programming-beginners/61112-setting-up-vc-and-directx.html

Original post by ChetanhlGo to ProjectProperties -> Linker->Input->addional dependencies and include d3dx9.lib

If you get to same error again then check directx path in Visual Studio.Refer to this link for detailed information on setting up directx with vc++ - http://www.uc-forum.com/forum/programming-beginners/61112-setting-up-vc-and-directx.html

First, he obviously didn't have the paths set up correctly because his error was about not finding a header file. He would eventually need to follow your instructions after fixing the compile time error, but you jumped the gun a bit :). Second of all, that forum gives instructions for pre-2010 versions of Visual Studio. The method of setting up include/library directories has changed since 2008 was released. It now must be set up for every project in the project properties section instead of in the application options.

I was having problems with finding the d3dx9.lib and header file too. I realised I was putting the Include and Library/x86 folders into the wrong part of the settings (This is with Visual C++ Express Studio 2010)