problem with direct3dcreate9

Started by
3 comments, last by Legion55 15 years, 9 months ago
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.
Advertisement
Looks like you have _d3d9 declared as an int, and not a pointer to IDirect3D9...

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
and look i'm not a beginer in c++ im a beginer in direct sdk, i know something about languages as c# ans c and c++ and assembler because im studing electronic engineering and I know something about poo and desing with uml and rup, but thanks anyway

This topic is closed to new replies.

Advertisement