2016-07-28 52 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") 

有沒有更好的解決有關此?我覺得這很奇怪!