Jump to content
  • Advertisement


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


DirectInput Problem (I'm in hurry, i really need help!)

This topic is 6010 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

Hello. I need help fast, so take care, please! I was working on win98, DirectX 8.0, VC++ 6.0, and was allright. I passed to a new machine, XP pro, same DX, same VC++, and now i get errors at compile time concerned with dIRECTINPUT: The compiler can''t deal with lines like: LPDIRECTINPUT8 g_pDI; LPDIRECTINPUTDEVICE8 g_lpDIDevice; (says that can''t see the type for the insances i make, in short) If i quote them all, it goes ok, (no input, obiously). It''s the SAME with the sdk examples, so it must be something related to the configuration, not my app. Yes, i set the VC++ paths like before. Yes, i set the .lib in project settings. All like before, but nothing! HELP! thanks... Michele.

Share this post

Link to post
Share on other sites
It''s probably a path problem.

When you compile the DI samples, do you get a message about undefined DIRECTINPUT_VERSION? If you don''t, then you''re including wrong headers. Maybe you installed the SDKs in different directories.

Also, try this: define LPDIRECTINPUT pdi; Note that this is DirectInput 1 interface. Now right-click LPDIRECTINPUT and choose ''go to definition''. VC will ask you to enable browing information; let it do so, and you''ll see the header that you''re including where LPDIRECTINPUT is defined.

Share this post

Link to post
Share on other sites

I''ve tried to do what you say, but it didn''t compile, so no good.
I''ve put the full path of .h: instead of i''ve used "C:\mssdk\include\dinput.h" in the includes (only for this one).
Now all is ok except this line :

hr = DirectInput8Create(GetModuleHandle(NULL) , DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&g_pDI, NULL );

that gives this error:

main.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
main.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A

note that the paths are configured ok (or it looks so) and if i quote this line, it compiles, and the browse works.
the call in Dinput.h is ''external'', so the error...

obviously it won''t run, because i faven''t initiated properly g_pDI (line quoted..)

i''m going MAD!

the paths i added are:


C:\MY2 (my project dir)
standard vc++ dirs


usual vc++ libs.



Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Are you really sure you''re using the Dinput8.lib lib? Because the error you get indicates that you don''t.

Share this post

Link to post
Share on other sites
Solved all.
How? don''t know. i deleted all the directories, reimposted *THE SAME* then it worked..
a mystery to me...

thanks the same,


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!