UE4源码编译错误解决:GenerateProjectFiles ERROR: Unable to find a valid installation of Visual Studio.

错误描述

GenerateProjectFiles ERROR: Unable to find a valid installation of Visual Studio. Please check that you have Visual Studio 2017 or Visual Studio 2019 installed, and the MSBuild component is selected as part of your installation.


错误原因

根据README.md,可能没有安装相应的C++组件:
UE4源码编译错误解决:GenerateProjectFiles ERROR: Unable to find a valid installation of Visual Studio.


解决方案

安装相应的C++组件:
UE4源码编译错误解决:GenerateProjectFiles ERROR: Unable to find a valid installation of Visual Studio.

确保已勾选以下内容:
UE4源码编译错误解决:GenerateProjectFiles ERROR: Unable to find a valid installation of Visual Studio.

UE4源码编译错误解决:GenerateProjectFiles ERROR: Unable to find a valid installation of Visual Studio.UE4源码编译错误解决:GenerateProjectFiles ERROR: Unable to find a valid installation of Visual Studio.

勾选后点击“修改”:
UE4源码编译错误解决:GenerateProjectFiles ERROR: Unable to find a valid installation of Visual Studio.