I have already downloaded the latest DX SDK (June 2010) and still, this error remains.


error C2065: 'IID_IDirect3D3' : undeclared identifier

I already included the headers below but it seems not to work, what am I missing?

#include <d3d9.h>
#include <ddraw.h>

Recommended Answers

All 4 Replies

Third hit on a google search for your undeclared identifier provides a substantial sample code. Right at the top of it:

#define INITGUID
//#define D3D_OVERLOADS //might need to "unremark" this line, depending on if you use the overloads
#include <windows.h>
#include <stdio.h>
#include <ddraw.h>
#include <d3d.h>

The differences are: including d3d.h instead of d3d9.h, and defining INITGUID before including it. Do either of these resolve your problem?

No, because now it says something like: can not include d3d.h, missing file...

and I already tried to include the DX SDK includes folder into the aditional include folder into my project settings but that didnt solve it.

I can find only one reference to your undeclared constant:

prompt$ pwd
<other path components>/Microsoft DirectX 9.0 SDK (Summer 2004)

prompt$ find Include/ -name \*.h -exec grep IID_IDirect3D3 {} /dev/null \;
Include/d3d.h:DEFINE_GUID( IID_IDirect3D3,            0xbb223240,0xe72b,0x11d0,0xa9,0xb4,0x00,0xaa,0x00,0xc0,0x99,0x3e);

This tells me you need to find that missing d3d.h file to proceed, but I could be wrong.

which DX SDK should I download then? because I already have downloaded the latest it this declaration was missing.
I am reinstalling the latest DX SDK and now downloading this update:

http://www.microsoft.com/download/en/confirmation.aspx?id=21416

there is no such d3d.h file here in my "C:\Program Files\Microsoft DirectX SDK (June 2010)\Include\" directory.

I guess its working now. thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.