Advertisement

A little help with DirectInput plz...

Started by January 17, 2002 06:50 PM
4 comments, last by Compaq 23 years, 1 month ago
Hi guys. Well I''ve been working on a 3d engine for a while and I''ve basically done most of it. But now I''m just working on the inputs and such. So I was reading Nehe''s tutorial on direct input and for some reason the command: LPDIRECTINPUT7 g_DI; doesn''t work. I did include dinput.h so that''s done... but the errors I get are: error C2146: syntax error : missing '';'' before identifier ''g_DI'' error C2501: ''LPDIRECTINPUT7'' : missing storage-class or type specifiers fatal error C1004: unexpected end of file found I''m not new to C++ and my engine does quite a bit but I''ve never worked with DirectInput before so I''m a little lost and the tutorial is what I''m currently going by. Although I will be going to check other sites now. But I figured I''d just post the question incase I made some stupid mistake...thanks PS: no flames plz. I''m just a highschool coder looking for some help... -------------------------- HelloWorld.exe HelloWorld.cpp - 13 Error(s), 23 Warning(s)
--------------------------HelloWorld.exeHelloWorld.cpp - 13 Error(s), 23 Warning(s)
are you using VC++?? If so make sure dinput.lib (dinput8.lib if your using dx8) is under your Project->settings->link? Are you using dx8 or dx7?
Advertisement
wow fast replies thanks. i downloaded the dx7 files from nehe''s tutorial here:
http://nehe.gamedev.net/tutorials/lesson23.asp
I currently have dx8.0 installed on my computer but the files are dx7. and i do have the .lib file placed in the settings link tab.

--------------------------
HelloWorld.exe
HelloWorld.cpp - 13 Error(s), 23 Warning(s)
--------------------------HelloWorld.exeHelloWorld.cpp - 13 Error(s), 23 Warning(s)
Anyone.... eh?

--------------------------
HelloWorld.exe
HelloWorld.cpp - 13 Error(s), 23 Warning(s)
--------------------------HelloWorld.exeHelloWorld.cpp - 13 Error(s), 23 Warning(s)
Perhaps you should try using the direct input code from the game programming tutorials on NeHe''s site. These use a directx 8 interface, so should give better results.
I had this problem too, it results from an old version of dinput.h in your include directory. Update it with the latest version from the DirectX SDK, and it should work.

This topic is closed to new replies.

Advertisement