Ue5 source code compilation error

When I compiled the source code of ue5 ea, vs reported the error “\Engine\Source\Runtime\Engine\Classes\Engine/Level.h(805): error C3668: “ULevel::GetWorld”: 包含重写说明符“override”的方法没有重写任何基类方法”.
The error points to the virtual class UWorld* GetWorld() const in Object.h.
This function is in the macro WITH_ENGINE.
So I tried to put the GetWorld function of ActorComponent.h into the WITH_ENGINE macro, and found that the error c3668 of ActorComponent.h disappeared. It seems that the WITH_ENGINE macro is missing from the project.
I am using win10, vs2019 community version. The source code is downloaded from github via sourcetree. bfe798c version.
Here is detail.

23>  [2/527] UnrealFileServer.cpp
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\NetworkFileSystem\Public\INetworkFileSystemModule.h(7): fatal error C1083: 无法打开包括文件: “ShaderCompiler.h”: No such file or directory

23>  [20/527] PCH.Engine.cpp
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Engine/Level.h(805): error C3668: “ULevel::GetWorld”: 包含重写说明符“override”的方法没有重写任何基类方法
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(789): error C2065: “FActorDataLayer”: 未声明的标识符
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(789): error C2923: “TArray”: 对于参数“InElementType”,“FActorDataLayer”不是有效的 模板 类型变量
23>  E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(789): note: 参见“FActorDataLayer”的声明
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(789): error C2976: “TArray”: 模板 参数太少
23>  E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Core\Public\Containers/Array.h(307): note: 参见“TArray”的声明
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(3110): error C3668: “AActor::GetWorld”: 包含重写说明符“override”的方法没有重写任何基类方法
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Public\Subsystems/WorldSubsystem.h(23): error C3668: “UWorldSubsystem::GetWorld”: 包含重写说明符“override”的方法没有重写任何基类方法
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Engine/World.h(1689): error C2065: “FAsyncPreRegisterDDCRequest”: 未声明的标识符
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Engine/World.h(1689): error C2923: “TSharedPtr”: 对于参数“ObjectType”,“FAsyncPreRegisterDDCRequest”不是有效的 模板 类型变量
23>  E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Engine/World.h(1689): note: 参见“FAsyncPreRegisterDDCRequest”的声明
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Engine/World.h(1689): error C2976: “TSharedPtr”: 模板 参数太少
23>  E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Core\Public\Templates/SharedPointer.h(560): note: 参见“TSharedPtr”的声明
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Engine/World.h(1689): error C3203: “TSharedPtr”: 未专用化的 类 模板 不能用作 模板 变量,该变量属于 模板 参数“InElementType”,应为 real 类型
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Engine/World.h(2606): error C3668: “UWorld::GetWorld”: 包含重写说明符“override”的方法没有重写任何基类方法
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Public\Physics/Experimental/PhysScene_Chaos.h(124): error C3668: “FPhysScene_Chaos::AddReferencedObjects”: 包含重写说明符“override”的方法没有重写任何基类方法
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Curves/CurveBase.h(82): error C3668: “UCurveBase::PostEditChangeProperty”: 包含重写说明符“override”的方法没有重写任何基类方法
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Sound/SoundEffectSource.h(62): error C3668: “USoundEffectSourcePresetChain::PostEditChangeProperty”: 包含重写说明符“override”的方法没有重写任何基类方法
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Public\ComponentReregisterContext.h(33): error C2039: "GetWorld": 不是 "UActorComponent" 的成员
23>  E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\AI/NavigationSystemBase.h(14): note: 参见“UActorComponent”的声明
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Public\ComponentReregisterContext.h(41): error C2039: "GetWorld": 不是 "UActorComponent" 的成员
23>  E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\AI/NavigationSystemBase.h(14): note: 参见“UActorComponent”的声明
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Animation/AnimSequenceBase.h(303): error C2039: "FAnimDataModelNotifyCollector": 不是 "UE::Anim" 的成员
23>  E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Animation/AnimData/IAnimationDataController.h(16): note: 参见“UE::Anim”的声明
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Animation/AnimSequenceBase.h(303): error C3646: “NotifyCollector”: 未知重写说明符
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Animation/AnimSequenceBase.h(303): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Animation/AnimSequence.h(1109): error C2065: “FBoneAnimationTrack”: 未声明的标识符
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Animation/AnimSequence.h(1109): error C2923: “TArray”: 对于参数“InElementType”,“FBoneAnimationTrack”不是有效的 模板 类型变量
23>  E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Animation/AnimSequence.h(1109): note: 参见“FBoneAnimationTrack”的声明
23>E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Engine\Classes\Animation/AnimSequence.h(1109): error C2976: “TArray”: 模板 参数太少
23>  E:\UnrealEngine-ue5-early-access\Engine\Source\Runtime\Core\Public\Containers/Array.h(307): note: 参见“TArray”的声明

Am i missing something ?

You should be using the ue5-early-access branch. Are you? The ue5-main branch is very unstable.

I am sure I am using the “ue5-early-access” branch.

Hmm… Sorry, I can’t help in that case.

First thing you should try doing is a clean clone of the git.
Reclone it, make sure you have all of the prerequisites listed on the git. From first glance it looks like it’s missing a header file, which can mean either the VS project isn’t properly configured (to point to dependencies) or you really are just missing some files.

Hey man, you are probably like me, a noob haha… I’m guessing this happened after you did a git pull to update the UE5 engine right?

I fixed this exact error by re-running “setup.bat” and “GenerateProjectFiles.bat”, then I could compile again with no problem. I didn’t have to clean solution or anything (luckily, this ■■■■ thing takes forever to compile)

@deitylink1 your suggestion worked for me too. Another thing I would say for future readers is to make sure and check nuget tasks when installing VS, it may not be installed automatically as of right now.

Thank you @deitylink1 and @rsabi for your reminder. Although I had executed Setup.bat and GenerateProjectFiles.bat before the above error occurred, I executed it again.
But the key point this time is that I am using an administrator shell and opened vpn. I can’t remember if I used the administrator shell before, I remember I used it. So this time I think the key lies in my opening vpn.
After I used the administrator shell and turned on vpn, I didn’t see that I had a new update, but it compiled and passed and it ran normally. Thank you both for your replies.