Tried to bring a UE4.27 project into UE5.0 and now all my includes fail

Hi - I had a working UE4.27 VR project (with C++) that I wanted to try out in UE5.0, so I started up UE5.0(.3) and opened my UE4.27(.1) project and the new migrated project fails to compile - looks like the include path or something is just broken.

I’m pretty new to Visual Studio so this might be something really obvious, but, any ideas?

Every single include, from all the .cpp files as well as the .h files are failing - including my own headers as well as the basic unreal stuff (Math/UnrealMathUtility.h, CoreMinimal.h, Kismet/BlueprintFunctionLibrary.h, etc.)


includesfail2
includesfail3

maybe you are lucky and just need to wait for some time. Visual Studio is doing some stuff behind scenes. Left down corner spinning circle, click on that and see if its doing something. it takes a couple of minute to figure out all the engine files and how they are related. Then all the errors will start to vanish

Unfortunately, no.

I’ve also tried to clean the build, remove the .vs and Intermediate folders and have unreal engine rebuild the VS project files. Still no go. Kind of weird!

A little more sleuthing around:

I made a brand new UE5 VR starter project and started comparing the differences between it and my migrated UE4.27->UE5 project, and noticed that the solution’s ‘Include Directories’ (as found in the window (in visual studio) brought up by right clicking on the project in the Solution Explorer → Properties → Configuration Properties → VC++ Directories → General → Include Directories), e.g. here:

is significantly different between the two projects. In my migrated project, the include directories list is tiny:

UE427to5IncludeDirectories

whereas in my brand new UE5 starter project, the include directories list is massive:

I tried copying the new UE5 project’s ‘include directories’ list into the migrated project’s ‘include directories’ list (and modifying the project name so that the …..\source{Project} relative path was correct), and that got rid of some, errors, though not all. e.g.

Did some digging on the forums here and the fix for that seems to be to have UE generate the VS project files again… but unfortunately for me that resets the ‘Include Directories’ property back to the old, broken, tiny list.

Any ideas?

What happens when you try to build it? What errors are shown in the text in the Output tab (not the Errors tab, which you should usually ignore).

@Ari_Epic :

Same output immediately after migrating and after trying to repair the ‘include directories’:

Build started...
1>------ Build started: Project: MyVRProject, Configuration: Development_Editor x64 ------
1>Using bundled DotNet SDK
1>Log file: C:\Users\Ribs\AppData\Local\UnrealBuildTool\Log.txt
1>Using 'git status' to determine working set for adaptive non-unity build (C:\Users\Ribs\Documents\GitHome\MyVRProject 5.0).
1>Creating makefile for MyVRProjectEditor (no existing makefile)
1>UnrealBuildTool : error : Unable to find plugin 'OculusOpenXR' (referenced via MyVRProject.uproject). Install it and try again, or remove it from the required plugin list.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command ""C:\Program Files\Epic Games\UE_5.0\Engine\Build\BatchFiles\Build.bat" MyVRProjectEditor Win64 Development -Project="C:\Users\Ribs\Documents\GitHome\MyVRProject 5.0\MyVRProject.uproject" -WaitMutex -FromMsBuild" exited with code 6.
1>Done building project "MyVRProject.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I see the OculusOpenXR error but I can’t remove it from the list because I can’t open the project in UE5.

can you check your struct files, if you have any. See if you can make them work in an empty project. I’m looking at some youtube tutorials to learn how to create a struct in code but boy it doesn’t work like the tutorial.

if it works, if you kind, please post one of the structs code so i can see how it should be.

@RibsNGibs Ah, I don’t think OculusOpenXR exists within UE 5.0. We’re trying to move most common VR functionality into the OpenXR plugin.
You can open MyVRProject.uproject with a text editor and edit it to remove the dependency to OculusOpenXR, or change it to just be OpenXR if there’s no mention of OpenXR already.

1 Like

Hi, i got the same problem too. Did you ever resolved the issue?

…I did but I can’t remember how I did it, sorry. It was a while ago. I remember it required a lot of “manual” work, so I suspect what I did was just make a clean UE5 project and then migrate all the assets from the old project over.

Mine’s working as well finally. It was because of some plugins dependency errors. For example there is a plugin that added PhysX module but PhysX is no longer in 5.1, that’s why it gives error and break the whole project.