I'm following the DirectXTK GamePad tutorial on how to incorparate a GamePad into my application but I'm getting an errorLNK2019 when trying to create the GamePad.
So far I've:
included GamePad.h to my Controller header file
Added
std::unique_ptr<DirectX::GamePad> mGamePad;
in my Controller class
In Controller::Init() added
mGamePad = std::make_unique<GamePad>();
And when I add that last line of code I get errors (loong ones):
DirectXTK.lib(GamePad.obj) : error LNK2019: unresolved external symbol __imp_RoGetActivationFactory referenced in function "long __cdecl ABI::Windows::Foundation::GetActivationFactory<struct ABI::Windows::Gaming::Input::IGamepadStatics>(struct HSTRING__ *,struct ABI::Windows::Gaming::Input::IGamepadStatics * *)" (??$GetActivationFactory@UIGamepadStatics@Input@Gaming@Windows@ABI@@@Foundation@Windows@ABI@@YAJPEAUHSTRING__@@PEAPEAUIGamepadStatics@Input@Gaming@12@@Z)
DirectXTK.lib(GamePad.obj) : error LNK2019: unresolved external symbol WindowsCreateStringReference referenced in function "private: void __cdecl Microsoft::WRL::Wrappers::HStringReference::CreateReference(wchar_t const *,unsigned int,unsigned int)" (?CreateReference@HStringReference@Wrappers@WRL@Microsoft@@AEAAXPEB_WII@Z)
fatal error LNK1120: 2 unresolved externals
In my application I already use the SpriteBatch without any problems so I'm guessing that I've done all the right things when I included DirectXTK to my solution.
I've also tried to create the GamePad using
mGamePad.reset( new GamePad() );
that I found in an older version of the tutorial.
Also.. The controller is inserted.. Any suggestions on what I'm doing wrong? Thank you!