@JonB Hi!
By "reinstalling everything" I meant VS 2022 and Qt, not the whole Windows OS.
I have tried the solution in the last post of the stackoverflow thread, adding the following lines to my .pro file:
INCLUDEPATH += "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/cppwinrt/winrt"
INCLUDEPATH += "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/shared"
INCLUDEPATH += "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt"
INCLUDEPATH += "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/um"
INCLUDEPATH += "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/winrt"
LIBS += -L"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22000.0/ucrt/x64"
LIBS += -L"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22000.0/ucrt_enclave/x64"
LIBS += -L"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.22000.0/um/x64"
And the original problems related to the inclusion of stddef.h have gone away. However, now the problems are other.
First: I have a resources file (to include just one image in my app). Well, jom complains about the existence of a .res file that, supposedly, should have been generated somehow.
Second: if I remove the resource file to see what happens, then the problem change and I get this:
LINK : fatal error LNK1158: cannot run 'rc.exe'
Assuming that QtCreator was not able to find rc.exe, I added the following line to my .pro file:
QMAKE_RC = "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x64/rc.exe"
which is part of the Windows SDK. However, the problem persists.
So my conclusion is that, by whatever reason, the Windows SDK is not correctly installed and not only the include / library directories are not available, but also other parts required to perform the building.
As I said yesterday, I'm going to uninstall everything, Window SDK, MSVC 2022 and Qt 5.12.2.
I'm not confident at all that this will work. I already did that in the past and it didn't worked, so I had to reinstall Windows completely. However, I must give it a try.