Jump to content
  • Advertisement

Archived

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

L1st3r

Direct Input problems...

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

Ok, I''m new to this...here''s my code, and errors: bool Input::initInput(HWND hWnd) { HRESULT hr; DWORD dwCoopFlags; freeInput(); dwCoopFlags = DISCL_EXCLUSIVE; dwCoopFlags |= DISCL_FOREGROUND; if( FAILED( hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&mDI, NULL ) ) ) { return hr; } if(FAILED(hr = mDI->CreateDevice(GUID_SysMouse, &mMouse, NULL))) { return(false); } if(FAILED(hr = mMouse->SetDataFormat(&c_dfDIMouse2))) { return(false); } hr = mMouse->SetCooperativeLevel(hWnd, dwCoopFlags); return(true); } and the h file: #include <dinput.h> #include "defines.h" class Input { public: Input(); ~Input(); bool initInput(HWND hWnd); void freeInput(); bool getInput(); protected: private: LPDIRECTINPUT8 mDI; LPDIRECTINPUTDEVICE8 mMouse; }; so I get these Errors: Linking... 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 dinput.lib(dilib5.obj) : error LNK2001: unresolved external symbol _GUID_ZAxis dinput.lib(dilib5.obj) : error LNK2001: unresolved external symbol _GUID_YAxis dinput.lib(dilib5.obj) : error LNK2001: unresolved external symbol _GUID_XAxis Debug/Scrabble.exe : fatal error LNK1120: 6 unresolved externals Error executing link.exe. Scrabble.exe - 7 error(s), 1 warning(s) I linked in d3d8.lib and dinput.lib....any ideas what I''m doing wrong? I want to apologize for the size of this post,

Share this post


Link to post
Share on other sites
Advertisement
Jim,
Thank you! That got rid of all the errors...now I have one other "question"...I still get this:

Compiling...
input.cpp
d:\projects\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
Linking...



it links fine, but why is this showing up?


Again, thanks for all your help!

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!