Skip to main content
GameDev.net gamedev.net
🔒 Locked

error C1083: Cannot open include file: 'd3dx9.h

Started by temuhin Sep 20, 2008 at 4:43 PM 3 replies 13.5k views
Original Post
temuhin
temuhin
Dear Forum, New to Visual C++ and DirectX, not so new to C++....Running Visual C++ Express 2008 on Windows XP (Laptop) with DirectX 9. I am going through the DirectXTutorial I have come to a point where I get the error message:
Quote:
error C1083: Cannot open include file: 'd3dx9.h
I managed to compile and run all previous examples, only when I have to include the 'd3dx9.h' header, the error message comes. I have also downloaded a second sample from Codesampler. I have no problems compiling that code even though the latter one also include the 'd3dx9.h' header. Now, the obvious reason this does not work is that somehow my compiler does not know where the d3dx9.h header file is. However, this .h file is in the same folder as the standard 'd3d9.h' header file, which my compiler has no problems in finding. Can anyone think of another reason this won´t work? with best regards temhu
yewbie
yewbie
is the include scope the same?
#include
vs
#include "d3dx9.h"

edit did you also include d3dx9.lib d3d9.lib to your linker on the command line?
temuhin
temuhin
Quote:
Original post by yewbie
is the include scope the same?
#include
vs
#include "d3dx9.h"

edit did you also include d3dx9.lib d3d9.lib to your linker on the command line?

Hi,

Yes, include scope is the same; both

As to your last question, I don´t know. Is that an option in VC or something I need to do from the cmd line...if I may ask...

(that said, the d33x9.lib and d3d9.lib files are also in the same folder.So if the latter one is found why not the first one?


regards

temhu
Drew_Benton
Drew_Benton
Quote:
Original post by temuhin
Now, the obvious reason this does not work is that somehow my compiler does not know where the d3dx9.h header file is. However, this .h file is in the same folder as the standard 'd3d9.h' header file, which my compiler has no problems in finding.

Can anyone think of another reason this won´t work?


My guess is that the paths for the DXSDK are not properly setup for the project. Navigate to where the folder is, something like C:\Program Files\Microsoft DirectX SDK (June 2008), and make sure you see the path to "lib" and "include" exist in your Visual Studio global settings (Tools->Options->VC++ Directories->"Show Directories For"->Include/Library)

Once you set those, recompile. If all else fails just include the header file directly, #include "C:\\Program Files\\Microsoft DirectX SDK (June 2008)\\Include\\d3dx9.h" and see if that works. If it does, it's just a folder that needs to be added to the path.

Also, always make sure you can find the file "d3dx9.h" in that directory too ;)

Good luck!
temuhin
temuhin
Thanks for the replies,

I have already tried specifying the path to the .lib and .h files from TOOLS->OPTIONS->PROJECTS AND SOLUTIONS->VC++ DIRECTORIES as well as including the complete path in the #include directive.

It did not work, at least not the 1st, 2nd 3rd 4th 5th 6th..time. Then mysteriously, it all compiled. I do not really know why since I did the same (I think) every time.

So, it works, but I don´t know why. .....

regards
temhu

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.