Hey all, ok so TLDR; It seems for some reason, using a local Process.h file in my project with newer versions of Visual Studio breaks compilation. Hopefully this post helps someone not waste a day figuring out why as I'm sure there are a few DIY engines out there with a process.h file! ?
Alright so in my game engine, I have a pre-compiled header (pch.h) which is compiled via pch.cpp as per the norm. Within pch.h, I have all the includes for the whole engine including a file called Process.h which has a class called CProcess (for... processing things).
Up until Visual Studio 2017 (using Platform Toolset v141) the pch would compile fine as would the whole engine. I just recently updated the project to VS 2022 and now when it starts compiling the pch file, it breaks with loads of errors when it gets to the Process.h. The errors make it seem almost like Process.h wasn't part of the project as within Process.h, project wide defines or data types aren't being detected hence all the errors. I noticed the Windows Platform SDK has a file called Process.h which seems to be part of the problem. Trying different versions of the Windows Platform SDK didn't make a difference.
My Process.h file is included with quotes (#include "Process.h") and didn't make a difference using angle brackets. If I switched the Platform Toolset back to v141 (VS 2017) things compile normally so this only seems to happen with later versions (both VS 2019 and 2022). The only way around this was to change the name of Process.h to Task.h and it started working again. Even leaving the class name as is (CProcess). So yeah. Oddballz.
Anyone have any idea why this happens?