Public Group

# DirectX set up problem

This topic is 4117 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Im new to directX I am learing from a book called "beginning direct3d game programming 2nd edition" I can go to the "DirectX Sample Browser" and I can install and run all the samples in visual studio with no problem. When i follow the book, I get stuck on the first basic sample. Cannot open include file: 'DXUtil.h': No such file or directory Cannot open include file: 'D3DUtil.h': No such file or directory Cannot open include file: 'D3DFont.h': No such file or directory I have linked (additional dependencies) d3dx9.lib d3dx9dt.lib d3d9.lib d3dxof.lib comctl32.lib winmm.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib includes C:\Program Files\Microsoft DirectX SDK (August 2006)\Include library C:\Program Files\Microsoft DirectX SDK (August 2006)\Lib\x86 one thing i did not link up dxsdk9\samples\c++\common\include I only could find up to "common" and none of the files inside of "common" are the missing(ex DXUtil.h). where i did find the files C:\Program Files\Microsoft Platform SDK\Samples\Multimedia\DirectShow\VMR\VMRMulti\D3DHelpers but i still get the same errors [Edited by - pascalosti on April 6, 2007 2:03:08 AM]

##### Share on other sites
Do you list any other build/include directories before the DX ones? I know that the order in which these things are entered is important.

I can't think of what else could be wrong - you seem to be doing this almost perfectly.

Oh yeah, I thought of something else. Check the code that you're actually trying to run. If you see some thing like

#include "DXUtil.h"

you need to change it to

#include <DXUtil.h>

This seems unlikely, but it's worth checking.

-synth_cat

##### Share on other sites
Im fairly new to Directx. I have been going by the code at <http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B7.aspx>
I have used it before, but I had to reconfigure my computer, and after I reloaded my WindowsXP and reinstalled C++ and directx SDK. I linked the files but I keep getting this error:

Unhandled exception at 0x0041224a in 1o2.exe: 0xC0000005: Access violation reading location 0x00000000.

I am only getting the error when I refer to the d3d9 files.

Whatt should I do?

##### Share on other sites
Quote:
 Cannot open include file: 'DXUtil.h': No such file or directoryCannot open include file: 'D3DUtil.h': No such file or directoryCannot open include file: 'D3DFont.h': No such file or directory

I may be horribly off base here, as I haven't done any C++ work with DirectX in a while (only C#, which doesn't have #include problems, thankfully), but I would say that those don't look like DirectX includes. They are more likely from the source on the CD that your book came with, as in custom code developed by the book's author to help you write your programs.

##### Share on other sites
Quote:
 Unhandled exception at 0x0041224a in 1o2.exe: 0xC0000005: Access violation reading location 0x00000000.I am only getting the error when I refer to the d3d9 files.

Sounds like a bad pointer somewhere. Run your code through the debugger and post the code around the lines that it stops at.

##### Share on other sites
The code stops at:

// create a vertex buffer interface called t_buffer
d3ddev->CreateVertexBuffer(20*sizeof(CUSTOMVERTEX),
0,
CUSTOMFVF,
D3DPOOL_MANAGED,
&t_buffer,
NULL);

##### Share on other sites
It must be something to do with your t_buffer, thats about the only thing there which which could point to a null location.

make sure that t_buffer is properly defined, like

IDirect3DVertexBuffer9* t_buffer; //assuming your using DX9

As for the include file problems, i think ussnewjersey4 was on the money with it being files the author of the book probarbly made, and aren't standard DX includes. Im going thru a book on DX myself and hes made similar include files which i downloaded with the samples. Usually theres not much in them though, like some extra debugging definitions (handy but not essential) and includes the standard DX files <d3d9.h> etc. which you can just do yourself.

1. 1
2. 2
Rutin
20
3. 3
JoeJ
17
4. 4
5. 5

• 37
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631705
• Total Posts
3001823
×