Cahute executables generated by VS 2022 are incompatible with Windows XP
- System and version: Windows XP Professional
- Architecture: x86 and x86-64
- Cahute version: 0.5
Executables generated by VS 2022 using the current instructions will not run on Windows XP.
This is because by default, after installing Desktop development with C++
workload in Visual Studio installer, VS will automatically select MSVC v143 toolset and Ninja generator. This leads to 2 issues:
- v143 only generates Windows Vista+ compatible codes. To solve it, first install
C++ Windows XP Support for VS 2017 [Deprecated]
inIndividual components
tab, then pass-T v141_xp
to CMake. - Ninja does not support toolset specification. For that purpose
Visual Studio 17 2022
must be specified as generator in CMakeSettings.json.
However, in my experiences VS still cannot compile Cahute because it cannot locate certain Windows SDK headers, despite the fact that they exist in the path they are supposed to be included.
The workaround to generate Windows XP compatible exes within Windows host is to switch to MinGW. Conveniently, there is a website that hosts pre-compiled MinGW builds for Windows. In VS there are also build configurations specifically for MinGW.
Edited by CalcLoverHK