Unreal Engine Cannot find metahost.h and typeinfo.h
Upgrading Visual Studio to v16.3 breaks Unreal Engine 4.23 compilation. Here's a temporary workaround if you don't want to modify the Engine.
Tags: ue4 visualstudio
Solution
Until the proper fix makes it into the next release, Unreal Engine can be compiled with the v14.22 instead of the v14.23 toolset.
First install the toolset:
- Launch the Visual Studio Installer
- Under the Installed tab in the Visual Studio 2019 item, click the More dropdown and select Modify
- Go to the Individual Components tab and enable MSVC v142 - VS 2019 C++ x64/x86-Buildtools (v14.22)
- Click the Install while downloading button in the bottom right
Unreal Build Tool (UBT) must be configured to use the v14.22 build tools:
- Open the local Unreal Engine build configuration in a text editor:
%AppData%\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
- Change the UBT configuration to use the 14.22 toolset:
<?xml version="1.0" encoding="utf-8" ?> <Configuration xmlns="https://www.unrealengine.com/BuildConfiguration"> <WindowsPlatform> <CompilerVersion>14.22.27905</CompilerVersion> <Compiler>VisualStudio2019</Compiler> </WindowsPlatform> <VCProjectFileGenerator> <Version>VisualStudio2019</Version> </VCProjectFileGenerator> </Configuration>
Finally, regenerate your project files and open the solution in Visual Studio to fix the project:
- Right-click the game project in the Solution Explorer
- Select Properties
- In the General section, change Include Directories to Inherit
The project should now compile again without errors.