Set Up Visual Studio 2026 or 2022 for Unreal Engine 5.7 and 5.8 (and Fix the Common Compile Errors)

Table of Contents

Works in Unreal Engine 5.7 and 5.8. Updated November 2026.

Quick answer:

  1. In the Visual Studio Installer, tick Game development with C++ (with IDE support for Unreal Engine) and Desktop development with C++.
  2. Under Individual components, add the MSVC toolset your engine expects: 14.44 for UE 5.7, 14.50 for UE 5.8 with Visual Studio 2026 (or 14.44 with 2022), plus Windows 11 SDK (10.0.22621.0).
  3. In Unreal, go to Edit > Editor Preferences > General > Source Code and set Source Code Editor to your Visual Studio version. Restart the editor.
  4. Right-click your .uproject file and choose Generate Visual Studio project files.

Which Visual Studio for which engine

Each engine version lists the compiler it was tested with in Engine\Config\Windows\Windows_SDK.json. We checked the files in our 5.7 and 5.8 installs:

EngineVisual StudioPreferred MSVC toolset
5.72022 (17.14), or 2026 (the editor labels it experimental)14.44
5.82026 or 202214.50 (VS 2026) or 14.44 (VS 2022)

The toolset matters more than the Visual Studio version. Unreal Build Tool uses the preferred toolset when it’s installed and otherwise falls back to the newest one, which causes most of the errors below. Visual Studio 2026 installs its newest compiler by default, so add the right one under Individual components (search for 14.44 or 14.50).

For a beginner on 5.7, Visual Studio 2022 is the least trouble. The forum’s support staff recommend it to beginners, and some people went back to it after fighting 2026. On 5.8, Visual Studio 2026 is fully supported.

“Visual Studio 2022 x64 must be installed in order to build this target”

You only have Visual Studio 2026, but Unreal is still looking for 2022. Unreal Build Tool reads the Source Code Editor setting to decide which compiler to use, so:

  1. Open any project in the same engine version (a blank Blueprint project is fine if your C++ project won’t open).
  2. Go to Edit > Editor Preferences > General > Source Code and set Source Code Editor to Visual Studio 2026.
  3. Restart the editor, close it, then right-click your .uproject and choose Generate Visual Studio project files.

We cover other causes of this error in Fix: Visual Studio 2022 x64 Must Be Installed.

UE 5.8: “Cannot open include file: ‘hash_map'”

The full error points at nvtess.h. MSVC 14.51 removed the old <hash_map> header, and the 5.8 code still uses it. You’ll mostly see this when building the engine from source.

Epic’s fix is to build with 14.50 (the toolset 5.8 was released with):

  1. In the Visual Studio Installer, choose Modify > Individual components, search for 14.50 and install the x64/x86 build tools.
  2. Rebuild. Unreal Build Tool picks 14.50 automatically because it’s on 5.8’s preferred list.

Epic has fixed the code in its main branch, but said the fix won’t go into 5.8 hotfixes. So stay on 14.50 for 5.8.

UE 5.8: “Cannot open include file: ‘BlueprintGraphClasses.h'”

This happens when Visual Studio offers to install the VisualStudioTools plugin (version 2.8) and you click Install to Engine. The fix is one line:

  1. Choose Install to Project instead. This copies the plugin’s source into your project’s Plugins folder.
  2. Open VisualStudioToolsBlueprintBreakpointExtension.cpp and change the include at the top:
				
					#include <K2Node_CallFunction.h> // was <BlueprintGraphClasses.h>
				
			

Then regenerate the project files and build.

Microsoft merged exactly this change into the plugin’s GitHub repository in September 2026, but the latest release (2.8) doesn’t have it yet. The plugin is optional: it adds Blueprint information to Visual Studio, and you can build and debug without it.

Red errors but the build succeeded? The Error List often shows IntelliSense errors that don’t stop the build. Check the Output window: if it says the build succeeded, you’re fine.

FAQ

Can I use Visual Studio 2026 with UE 5.6 or older?

Not directly. 5.6’s build tool doesn’t know Visual Studio 2026 at all. Install the free Visual Studio 2022 Build Tools with Desktop development with C++ alongside 2026.

My new C++ class doesn’t show up in the editor after building.

Close the editor before building when you add new classes or change headers. Live Coding is meant for small changes inside .cpp files.

Related articles