Getting xInput.h to work with cLion

I am coding using cLion and debugging using Visual Studio.
I have installed MingW to go with clion. However when I am trying to include xInput.h clion can't find it.

I searched on the internet and added
include_directories("C:/Program Files (x86)/Windows Kits/8.1/Include/um")
to the cmakelists.txt file. It solves the xinput.h problem but creates a new problem.


I want to compile and debug the same way as casey does(i.e.compile with build.bat file, debug with Visual Studio).
I only want to have the features of cLion as the code editor.

Any solution as to tell clion from where to look for xinput.h file without causing it conflict for windows.h file?
I've moved from Windows to Linux so I can't help much, but I had trouble compiling HMH on Windows using CLion, until I found a decent version of MinGW. See my post and mmozeiko's post just after it here:

https://hero.handmade.network/forums/code-discussion/t/191

I also posted a CMake project for Ep 21.
https://hero.handmade.network/forums/code-discussion/t/191/p/7701

Word of warning. The error detection in CLion goes haywire when Casey starts including .cpp files inside .cpp files. The issue is here:
https://youtrack.jetbrains.com/issue/OC-5581

Edited by Mór on
You probably need to use mingw that has xinput.h instead of trying to force it to use one from Windows SDK.
The mingw I use (mingw-w64, part of msys2) has xinput.h header in standard installation, so it should work with it right out of the box.
I have installed msys2 64-bit version.
However when I am trying to set it as my MingW I am getting this error:
The link for the cmake project file that you have given is dead. Can you re-upload that?
MinGW-w64 is installed in subdirectory of msys. Msys itself is bunch of other tools that Clion doesn't need.
Try something like C:\msys64\mingw64 or C:\msys64\mingw64\x86_64-w64-mingw32 (not sure which one clion wants). And check if these folders exist, if they don't then you haven't installed mingw from msys.

Edited by Mārtiņš Možeiko on
ishanatmuz
The link for the cmake project file that you have given is dead. Can you re-upload that?


Here you go.

https://uploadfiles.io/ecb8