Jump to content
  • Advertisement

Archived

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

sledge

Newbie + DirectInput = This Topic

This topic is 5954 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, I''m trying to create my own 3d engine (like the rest of us ) but suffer from complete newbieism. Every time I try to compile my program, I get the same error messages from DirectInput. I''m sure there is a really simple fix for this, but right now it is beyond me! Any help would be greatly appriciated This is the compile error I keep getting, well a section of it anyway:
input.cpp
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(646) : error C2501: ''UINT_PTR'' : missing decl-specifiers
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(646) : error C2146: syntax error : missing '';'' before identifier ''uAppData''
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(646) : error C2501: ''uAppData'' : missing decl-specifiers
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(658) : error C2501: ''UINT_PTR'' : missing decl-specifiers
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(658) : error C2146: syntax error : missing '';'' before identifier ''uAppData''
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(658) : error C2501: ''uAppData'' : missing decl-specifiers
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(1056) : error C2501: ''UINT_PTR'' : missing decl-specifiers
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(1056) : error C2146: syntax error : missing '';'' before identifier ''uData''
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(1056) : error C2501: ''uData'' : missing decl-specifiers
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(1209) : error C2501: ''UINT_PTR'' : missing decl-specifiers
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(1209) : error C2146: syntax error : missing '';'' before identifier ''uAppData''
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h(1209) : error C2501: ''uAppData'' : missing decl-specifiers
 

Share this post


Link to post
Share on other sites
Advertisement
Just for the record, I am having this same exact problem. I thought it was my compiler (I am using MSVC++ 4.0), but now that someone else has this problem, there must be a setting that I am overlooking (unless sledge also has an older compiler).

And I am sure it is not my code, because I have tried compiling both ShiningKnight''s game tutorials and the game from "OpenGL Game Programming."

Share this post


Link to post
Share on other sites
Okay. Where is the DXSDK installed on your system? It looks as though it''s grabbing header files from your VC Include directory. That might be the way you intentionally have it set up, but if the most recent DX headers are anywhere else, put the directory first on your directory list for Include Files within the VC IDE.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[if you have a link proposal, email me.]

Share this post


Link to post
Share on other sites
No, it''s not a DX include problem, it''s your old compiler. Include this file: <basetsd.h> and you should be fine.

Share this post


Link to post
Share on other sites
I'm not sure if it is the old compiler, because I'm using MSVC++ 5.0 (yes, i guess that is still old to, but hey ) and it just wont work. I tried including basetsd.h and though it fixed the previous problem I had, now it gives me unresolved external symbols.

Here is exactly what went wrong:

--------------------Configuration: engine - Win32 Debug--------------------
Compiling...
main.cpp
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
engine.cpp
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
input.cpp
C:\Program Files\DevStudio\VC\INCLUDE\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
Linking...
input.obj : error LNK2001: unresolved external symbol _c_dfDIKeyboard
input.obj : error LNK2001: unresolved external symbol _GUID_SysKeyboard
input.obj : error LNK2001: unresolved external symbol _c_dfDIMouse
input.obj : error LNK2001: unresolved external symbol _GUID_SysMouse
input.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
input.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
...\bin\debug\engine.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.

engine.exe - 7 error(s), 0 warning(s)


[edited by - sledge on May 31, 2002 10:55:32 PM]

Share this post


Link to post
Share on other sites
To fix the DIRECTINPUT_VERSION errors, add this before you include dinput.h:
#define DIRECTINPUT_VERSION 0x0800

To fix the other errors, add dinput8.lib to the linker''s list of libraries.

Share this post


Link to post
Share on other sites
IndirectX: Thanks, "basetsd.h" did it for me.

Also, does anyone know where the sinf, cosf, and sqrtf functions are located? ShiningKnight uses them in his tutorials but I am getting undeclared indentifier errrors.

And are there any other header files I should include when using an older compiler. It seems like I always get errors when I use code made for 6.0.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!