problem with direct3dcreate9
hello friend
look im trying to create a direct object in vc++ 7 with microsoft visual studio 2005
I'Ve linked
d3d9.h
d3dx9.h
d3d9.lib
d3dx9.lib
windows.h
winmm.lib
and no problem but when I type:
"_d3d9 = Direct3DCreate9(D3D_SDK_VERSION)"
then There were build error
the errors are
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2440: 'initializing' : cannot convert from 'IDirect3D9 *' to 'int'
PLEASE help me PLEase ...what can I do????
thanks thaanks.
Looks like you have _d3d9 declared as an int, and not a pointer to IDirect3D9...
Try:
LPDIRECT3D9 pd3d = Direct3DCreate9(D3D_SDK_VERSION);
Try:
LPDIRECT3D9 pd3d = Direct3DCreate9(D3D_SDK_VERSION);
Quote:Original post by Wild Bill Kelso
Looks like you have _d3d9 declared as an int, and not a pointer to IDirect3D9...
Try:
LPDIRECT3D9 pd3d = Direct3DCreate9(D3D_SDK_VERSION);
No he hasnt declared it as an int. The compiler cannot assume type 'int' (apparently the default type in C++) because C++ doesnt assume types.
You need to declare what type of variable _d3d9 is. In this case it is above IDirect3D9* or the typedef LPDIRECT3D9.
You may not want to try Direct3D yet as it seems you are still a beginner in C++ I'm assuming and learning the language should be more of a priority than trying to use the DX sdk at this stage. Correct me if I'm wrong though.
thans to u 2 guys i've type
LPDIRECT3D9 g_pD3D = Direct3DCreate9(D3D_SDK_VERSION);
and then the program run successfully thanks really tahnks
LPDIRECT3D9 g_pD3D = Direct3DCreate9(D3D_SDK_VERSION);
and then the program run successfully thanks really tahnks
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement