简体   繁体   中英

Unresolved External Symbols

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.

尝试将库dxguid.lib(可能还有dinput8.lib)添加到链接器标志。

go to Project-> properties->Linker-> Input->Additional dependencies and add "dxguid.lib" -> apply. It work for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM