I finally got it to compile, these are the steps:
-
Download the source code from GitHub as a ZIP archive file instead of using Git clone
-
Unpack the ZIP, run Setup.bat, then GenerateProjectFiles.bat
-
Open the solution (.sln) file in Visual Studio 2019
-
Right-click on the project you’re trying to build (UE4), select properties, then navigate to “VC++ Directories”
-
Find the options “Include directories” and “Library directories”, change both to “Inherit from parent or project defaults”
- Apply and build (rebuild to be safe)
This fixed all of my original problems, check the other answers on this thread if this does not work for you.
TL;DR: Download the source code as ZIP instead of using Git clone, check your VC++ Directories in VS.