🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Problem with DirectX in Lesson 27....

Started by
5 comments, last by TipTup 23 years, 12 months ago
Anyone know why LPDIRECTINPUT7 is undefined when I try to compile lesson 23? I already have the SDK installed, I even search dinput.h and could not find LPDIRECTINPUT7... Any suggestions? --------------------Configuration: lesson23 - Win32 Debug-------------------- Compiling... Lesson23.cpp Lesson23.cpp(16) : error C2146: syntax error : missing '';'' before identifier ''g_DI'' Lesson23.cpp(16) : error C2501: ''LPDIRECTINPUT7'' : missing storage-class or type specifiers Lesson23.cpp(16) : fatal error C1004: unexpected end of file found Error executing cl.exe. lesson23.exe - 3 error(s), 0 warning(s)
Advertisement
did you include the dxguid.lib library file ?
Do you have DirectX version 7 or later ?


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

yes and yes =(

-TipTup
TipTup.Com
Do you have the DirectX SDK v.7?
Is your path set correctly?
Is this your first DirectX call in this file (i.e.: does any previous DX keywords pass?)?
Did you solve your problem?

EL

----------------------------------------
"Inash neteia haeg joa kavari quilm..." SD4
----------------------------------------"Inash neteia haeg joa kavari quilm..." SD4
Do you have the DirectX SDK v.7?
Yes. The first release if that matters.

Is your path set correctly?
Yes.

Is this your first DirectX call in this file (i.e.: does any
previous DX keywords pass?)?
Yes its the first call from directx... see the c&p below..

Did you solve your problem?
Nope!


#include
#include
#include
#include
#include
#include
#include

LPDIRECTINPUT7 g_DI; // ERROR is Here.. missing ;
LPDIRECTINPUTDEVICE7 g_KDIDev;

-TipTup
TipTup.Com
lol the html took out the includes...

-TipTup
TipTup.Com
Could you try this very simple code?
    #include <windows.h>#include <dinput.h>#include <iostream.h>int main(){  cout << DIRECTINPUT_VERSION;  return 0;}    


It should return 1792 (0x0700) if everything''s OK.

If it returns anything less, then the SDK is not v.7 (maybe an older is taking priotity? Move the new SDK path to the top of your path list)
If it does not compile at all, then dinput.h is not found (or I made a mistake in this simple code, haven''t tested it).

I''d like you to reply

EL

----------------------------------------
"Inash neteia haeg joa kavari quilm..." SD4
----------------------------------------"Inash neteia haeg joa kavari quilm..." SD4

This topic is closed to new replies.

Advertisement