2016-07-28 53 views
0

我得到一个未定义的参考XInputGetState,我不知道为什么。 我使用的标题是:XInput.hWindows.h与xbox 360控制器功能的链接器错误

FIRSTPLAYER只是常数0

XINPUT_STATE state; 
ZeroMemory(&state, sizeof(XINPUT_STATE)); 
// Simply get the state of the controller from XInput. 
dwResult = XInputGetState(FIRSTPLAYER, &state); 

任何意见都会很好。

我使用CodeBlocks IDE和MinGW作为编译器。

回答

0

好吧,所以我想通了。 缺少这一行:

#pragma comment(lib, "XInput.lib") 

有没有更好的解决有关此?我觉得这很奇怪!