Archived

This topic is now archived and is closed to further replies.

coderx75

Very strange DirectInput problem...

Recommended Posts

coderx75    435
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!

Share this post


Link to post
Share on other sites
coderx75    435

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!

Share this post


Link to post
Share on other sites
coderx75    435
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!

Share this post


Link to post
Share on other sites
coderx75    435
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!

Share this post


Link to post
Share on other sites
Biggles    122
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.

Share this post


Link to post
Share on other sites
Prime    122
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

Share this post


Link to post
Share on other sites