diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e1c9fcb1..552f04ac0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -473,7 +473,7 @@ if(USE_WIIUSE) endif() if(MSVC OR MINGW) - target_link_libraries(supertuxkart iphlpapi.lib xinput) + target_link_libraries(supertuxkart iphlpapi.lib) add_custom_command(TARGET supertuxkart POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/dependencies/dll" diff --git a/lib/irrlicht/CMakeLists.txt b/lib/irrlicht/CMakeLists.txt index c7d649612..545e857ca 100644 --- a/lib/irrlicht/CMakeLists.txt +++ b/lib/irrlicht/CMakeLists.txt @@ -570,5 +570,5 @@ if(ENABLE_WAYLAND_DEVICE) endif() if(WIN32) - target_link_libraries(stkirrlicht imm32) + target_link_libraries(stkirrlicht imm32 XINPUT9_1_0.LIB) endif() diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp index 04d568a36..a2834c7ab 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp @@ -20,6 +20,10 @@ #include #include #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) +// This define will switch to use XInput 9.1, which does not +// require an installer and works on most windows platforms. +// See https://blogs.msdn.microsoft.com/chuckw/2012/04/25/xinput-and-windows-8/ +#define _WIN32_WINNT 0x0601 #include #ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ #define DIRECTINPUT_VERSION 0x0800