New UE5 c++ project cannot find header files and open source file in visual studio 2019

I am curious how to fix this. As soon as I open a new c++ project and enter visual studio, and the solution finished compiling, I receive around 10 000 errors stating cannot open sources files, the likes of CoreMinimal.h.

Basically, it worked both fine with visual studio 2019 and Unreal Engine 4.27,
also, it worked with Visual studio 2019 and Unreal Engine 5.0 Early access without any problem,

But with the official release of Unreal Engine 5, as soon as I create a new project or upgrade an existing project to UE5, Visual studio suddenly cannot find header files, Giving me between 7000 and 12000 errors. Not what I like to see on a new project.

Before anyone propose the solution of generating the source files, I already followed those steps without any changes.
Cannot open source file name.generated.hc.

I also try manually placing the directory location, in option / NMake / Include Search Path, it also did nothing.

Code error E1696

12 Likes

Hi, I have the same issue and I could not solve it. Did you find how?

Yuup, exact same issue here. And I guess because of this, but my intelisense is reeeeeealy slow (takes minutes) and so is my build time from UE. Feels wrong (VS 2019)

I did not find how to fix the error of not finding the header files, but I since learned that the workflow is really different from my experience with Unity, while Unity compile the solution each time I saved a script, by following a udemy tutoriel with unreal engine 5, it seems each time i am really ready to compile, i must close the Unreal project, and then compile in visual studio,

I have also been recommended to completely disregard Intelisense, So yeah…
still works but seems weird but i got used to it.

I’m having the exact same issue, I ported my project to UE5 and the header files don’t seem linked. The compiler doesn’t find them and right-clicking “Go-To Document” fails to find the header, despite the path being correct.

I fixed this by upgrading the windows 10 sdk. In VS installer, select game development, and uncheck win10 sdk 19.something and select the latest win10 sdk which for me was 22.something. You can probably leave 19 installed if you need it, but I didn’t.

Didn’t work for me but thanks for sharing.

Can Epic maybe fix this so that coding in the only language they let us code in isn’t the worst possible experience? Remember when they used to tell people to straight-up disable IntelliSense? Are we going back to those days so I can have lighting that looks good at 2 fps from a still camera and still shows temporal artifacting? Sure seems like the priorities are in check

3 Likes

I just looked closer and you’re right it didn’t fully work for me either. I have 1100+ warnings and 11 errors instead of 1200+ errors after the SDK change but intellisense is working now regardless. Building inside VS also works despite the 10 errors. All I was trying to fix was colorizing the code so I’m happy.

I played with the includePaths some more since it was giving multiple definitions when it shouldn’t.

I updated includePaths to look like:

{
...
"ue5IncludePathHack": [
            "${workspaceFolder}/**",
            "<path to ue5 repo>/UnrealEngine/Engine/Source/Runtime/Core/Public/**",
            "<path to ue5 repo>/UnrealEngine/Engine/Source/Runtime/CoreUObject/Public/**"
        ]

...
}

I have a imperfect workaround for VSCode until they fix this problem. It seems like VSCode needs some guidance on where to look. I updated my c_cpp_properties.json to look something like this:

{
    "env": {
        "ue5IncludePathHack": [
            "${workspaceFolder}/**",
            "<path to ue5 repo>/UnrealEngine/Engine/Source/**"
        ]
    },
    "configurations": [
        {
            "name": "scarEditor Editor Linux Development (scar)",
            "intelliSenseMode": "linux-gcc-x64",
            "cppStandard": "gnu++17",
            "compilerPath": "/usr/bin/gcc",
            "includePath": ["${ue5IncludePathHack}"],
            "browse": {
              "limitSymbolsToIncludedHeaders": true,
              "databaseFilename": ""
            }
        },
        {
            "name": "Linux",
            "intelliSenseMode": "linux-gcc-x64",
            "cStandard": "gnu17",
            "cppStandard": "gnu++17",
            "compilerPath": "/usr/bin/gcc",
            "includePath": ["${ue5IncludePathHack}"],
            "browse": {
              "limitSymbolsToIncludedHeaders": true,
              "databaseFilename": ""
            }
        }
    ],
    "version": 4
}

Its not perfect… this allows intellisense to work but might see some complaints in ue5 source files. However, it seems to be close enough to how it was for ue4.

Also, you’ll have to reset this file after clicking on “Refreshing Visual Studio Code” in UE5 Editor.

Hope this helps

I disabled Live Coding. The errors are still there but I can build now.

For me, it fails to build anything related to windows.h files or win32 files. cannot bitmap or do sockets or anything related to headers and linking does not help. I don’t know if this is related to your issue but UE5 only seems to work with its own header files which is massively limiting a lot of projects who saw potential with coding in cpp.

Same problem with both fresh install of UE5 and 5.3 with VScode. Is there a general fix / faq for this please? I’ve tried editing paths, to no avail, and usually just end up breaking the project so it won’t load.

1 Like

Have you solved the problem? I also created a C++class in the blueprint project, which directly caused the inability to find header files such as coremini. h, and the project was scrapped

1 Like

This worked for me:

c++ - Visual Studio Code/Intellisense cannot find Unreal Engine CoreMinimal.h file - Stack Overflow

Had same in brand new Unreal Project. The Solution explorer complained it couldnt find the engine sources, Nor the games generated source files it generated.
Building and clean and rebuild all sucessful but no Intellisense.

To fix for me, in the UE Editor, with Visual studio closed.

Select Tools-> New C++ class,
select public , All classes → Object.
Called it temp as I am going to delete later.
Create the class and select to open in Visual Studio.
On opening it then popped up about linking in other projects, and solution to link the UE source projects and then find the generated Character and Game mode headers.
Closed everything and repoened just to be sure and still picked up everything.

1 Like

To fix for me, in the UE Editor, with Visual studio closed.

Select Tools-> New C++ class,
select public , All classes → Object.
Called it temp as I am going to delete later.
Create the class and select to open in Visual Studio.
On opening it then popped up about linking in other projects, and solution to link the UE source projects and then find the generated Character and Game mode headers.
Closed everything and repoened just to be sure and still picked up everything.
[/quote]

This fixed mine too! I didn’t get a message about linking, but it asked to reload everything and that seems to have corrected this issue.

I was just trying to follow the basic networking tutorial but use 5.5… It’s been like 8 hours of work to get a new project to work in Visual Studio Community 2022. What a PITA.

Sadly, this does not work for me, because I cannot open my project in the editor. It keeps saying that I have to rebuild it, but that obviously will not work because of this issue.
I have tried all the usual “fixes”, however nothing works.

I am using UE 5.6 and visual studio 2022.

It does not matter what project I choose (new or existing), nothing works.
Thanks for any help.

Edit:
It seems that the include directory paths are not added to the project config!

Complete Fix Guide: UE 5.7 + VS2022 C++ Compile Failures, Missing Module Errors & Broken Project Generation

This step-by-step guide resolves the most common UE 5.7 C++ project issues on Windows, including failed auto-compile after adding a new C++ class, “modules missing/built with a different engine version” errors, missing right-click project generation options, and VisualStudioTools build failures.


My Environment

  • Engine Version: Unreal Engine 5.7

  • IDE: Visual Studio 2022

  • Operating System: Windows 11


Step-by-Step Fix Workflow

Step 1: Fully Delete Stale Build Cache

First, completely close the Unreal Engine Editor and Visual Studio to avoid file lock issues.

Navigate to your project root directory, and permanently delete these 3 auto-generated cache folders (your source code and assets will NOT be lost):

  • Binaries

  • Intermediate

  • .vs (this is a hidden folder; enable Hidden items in the File Explorer View tab to see it)

Step 2: Remove Invalid VisualStudioTools References

The root cause of most VisualStudioTools build errors is leftover invalid references in your project config files. Inspect and clean the following files:

  1. Go to your project’s Source folder, open and check these 3 files:

    • [YourProjectName].Build.cs

    • [YourProjectName].Target.cs

    • [YourProjectName]Editor.Target.cs

  2. Open your project root’s [YourProjectName].uproject file with a text editor.

  3. Ensure there are no references to VisualStudioTools in any of these files. Delete any lines or plugin entries that include this module name, then save all changes.

Step 3: Regenerate Visual Studio Project Files

Use one of the two methods below to generate a fresh Visual Studio solution (.sln) file:

Method 1: Right-Click Context Menu (Simplest)

  • Right-click your [YourProjectName].uproject file

  • Select Generate Visual Studio project files from the context menu

  • If this option is missing, see the bonus fix at the end of this guide to restore it.

Method 2: PowerShell Command (100% Reliable, No Context Menu Required)

  1. Open PowerShell in your project root directory (type powershell in the File Explorer address bar and press Enter)

  2. Copy and paste the command below, replace studyProject.uproject with your actual .uproject file name, then run it:

    powershell

    & "C:\Program Files\Epic Games\UE_5.7\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.exe" -projectfiles -project="$PWD\studyProject.uproject" -game -rocket -progress
    
    
  3. Wait for the command to finish. A Result: Succeeded message confirms the solution file was generated successfully.

Step 4: Manually Build Your Project in Visual Studio

  1. Double-click the newly generated [YourProjectName].sln file to open it in Visual Studio 2022.

  2. At the top of the Visual Studio window, set these two critical build configurations:

    • Solution Configuration: Development Editor (do NOT use DebugGame or Shipping for editor-compatible builds)

    • Solution Platform: Win64

  3. In the Solution Explorer panel (usually on the right), find your [YourProjectName] project node (under the top-level solution).

  4. Right-click the project node, then select Build.

  5. Wait for the build process to complete. A Build succeeded message in the Output window means the process is complete.


Final Verification

  1. Close Visual Studio after a successful build.

  2. Double-click your .uproject file to launch Unreal Engine.

  3. The editor will launch without errors, and your newly added C++ class will appear in the Content Browser as expected.


Bonus Fix: Restore Missing “Generate Visual Studio project files” Right-Click Option

This issue is caused by an incorrect file association for .uproject files:

  1. Right-click your .uproject file → Select Properties

  2. On the General tab, click Change next to “Opens with”

  3. Click More apps → Scroll to the bottom and select Look for another app on this PC

  4. Navigate to one of the paths below, select UnrealVersionSelector.exe, and click Open:

    • Launcher Path (Recommended): C:\Program Files (x86)\Epic Games\Launcher\Engine\Binaries\Win64\UnrealVersionSelector.exe

    • Engine Path: C:\Program Files\Epic Games\UE_5.7\Engine\Binaries\Win64\UnrealVersionSelector.exe

  5. Check “Always use this app to open .uproject files”, then click OK.

  6. For a full system repair, right-click UnrealVersionSelector.exe → Run as administrator, then confirm the engine association repair prompt.


Key Notes to Avoid Common Pitfalls

  1. Never skip deleting the cache folders: Binaries, Intermediate, and .vs are the source of 90% of “different engine version” errors, and deleting them will not affect your project’s source code or assets.

  2. Use correct PowerShell syntax: The & operator at the start of the command is required to run executables with quoted paths in PowerShell, and $PWD is PowerShell’s native variable for the current working directory (the equivalent of CMD’s %cd%).

  3. Double-check your build configuration: You must use Development Editor for builds that will work with the Unreal Engine editor.

  4. Invalid VisualStudioTools references can live in more than just your .Build.cs file: Always check your .Target.cs files and .uproject plugin list as well.