Very strange DirectInput problem...

Started by
8 comments, last by coderx75 22 years, 4 months ago
Hey Ppl''z, I''ve been workin'' on a game using DirectDraw and DirectSound. Both compile and execute beautifully. Now, I''m trying to add in DirectInput. I''ve linked in dinput.lib, winmm.lib and included dinput.h, mmsystem.h but when I compile I get 30 or so errors... first of which says that ''DirectInputCreate'' : undeclared identifier. The rest are similar errors. I''m doing everything exactly as I did for DirectDraw and DirectSound... has anyone else run into this problem before? BTW, all headers are included from within another header file and all .cpp files are including this file. This file structure works fine for the other DirectStuff. And of course, all headers and source are in the project as they should be. Any ideas? I''m stumped =( - Jay Many of the truths we cling to depend greatly on our own point of view
Get Tranced!
Quit screwin' around! - Brock Samson
Advertisement

Hmmm another twist...

I just added:
#define DIRECTINPUT_VERSION 0x0300

before I include dinput.h

Now I no longer get the 30 or so errors but instead I get these errors:
syntax error : missing '';'' before identifier ''CreateDevice2''
''LPDIRECTINPUTDEVICE2'' : missing storage-class or type specifiers


Many of the truths we cling to depend greatly on our own point of view

Get Tranced!
Quit screwin' around! - Brock Samson
Make sure you link to dxguid.lib as well as dinput8.lib.

Btw, If you''re going to define your DINPUT version, don''t you want 0x0800?

-M
I used 0x300 just to test... I included the other libraries but still no dice. If it''s coming up as an undeclared identifier then wouldn''t that be a problem with the dinput.h header and not the libraries? With dxguid and dinput8 links in, I still get the 32 errors I was getting before

Many of the truths we cling to depend greatly on our own point of view

Get Tranced!
Quit screwin' around! - Brock Samson
What are the 30+ errors?

Invader X
Invader''s Realm
I believe you want DirectInput8Create anyway...

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
I''m using a very dated book ... DX5. Compiling the sample code in the book doesn''t even work... causes the same problems. I''ll need to hunt down a more updated resource. THEN, I''ll ask questions if I have more problems. Of course, if I have an updated resource, I probably won''t have probs =) Thanx!

- Jay


Many of the truths we cling to depend greatly on our own point of view

Get Tranced!
Quit screwin' around! - Brock Samson
Look at the Direct X 8.1 docs on MSDN. They do a pretty good job at explaining how to setup Direct Input

Invader X
Invader''s Realm
I would highly recommend trying the DirectInput tutorials in the SDK. They take you through input setup for many different devices step by step.


--------------------

Never eat anything bigger than your own head.
--------------------Never eat anything bigger than your own head.
For an example of how to set up and use the basic DirectInput functionality, you can download my game engine, which has all the source code and comes with a simple demo. It uses DirectX 7, and shows you how to set up your project and include all the files. There might be something in there you can make use of. Anyway, it can be found at the bottom of the page at:

http://warped.prodns.tripod.com/engine.html

If you have any questions, let me know. Hope it helps.

Cheers,
Prime

This topic is closed to new replies.

Advertisement