I'm working on a small game that requires mouse input (position and left clicks). I have a GameManager class that controls a GameScreen, which includes d3d9.h d3dx9.h
and dinput.h
. I had everything working (building, no errors) before I added the mouse input code and #include <dinput.h>
. However now, I can't build and am faced with
1>GameScreen.obj : error LNK2001: unresolved external symbol _GUID_SysMouse
1>GameScreen.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
1>dinput8.lib(dilib1.obj) : error LNK2001: unresolved external symbol _GUID_ZAxis
1>dinput8.lib(dilib1.obj) : error LNK2001: unresolved external symbol _GUID_YAxis
1>dinput8.lib(dilib1.obj) : error LNK2001: unresolved external symbol _GUID_XAxis
And aren't sure what caused it. In my Linker I have d3d9.lib;d3dx9.lib;dinput8.lib;%(AdditionalDependencies)
as Additional Dependencies, and I've made sure all those files are present in the x86 DirectX directory. I can provide additional information if need be, I'm new to C++ so I'm not sure what's typical protocol for sharing relevant information.
Try adding the library dxguid.lib (and possibly dinput8.lib) to your linker flags.
go to Project-> properties->Linker-> Input->Additional dependencies and add "dxguid.lib" -> apply. It work for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With