# Ue5 source code compilation error

**URL:** <https://forums.unrealengine.com/t/ue5-source-code-compilation-error/236764>\
**Category:** Character & Animation\
**Tags:** unreal-engine, UE5-0\
**Created:** [June 22, 2021, 8:38am UTC](https://forums.unrealengine.com/t/ue5-source-code-compilation-error/236764 "2021-06-22T08:38:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![0xcdafd0f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@0xcdafd0f1](https://forums.unrealengine.com/u/0xcdafd0f1)\
**Post date:** [June 22, 2021, 8:38am UTC](https://forums.unrealengine.com/t/ue5-source-code-compilation-error/236764/1 "2021-06-22T08:38:21Z")

</div>

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.

```auto
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 ?

---

<div class="post-metadata">

**Author:** ![0xcdafd0f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@0xcdafd0f1](https://forums.unrealengine.com/u/0xcdafd0f1)\
**Post date:** [June 23, 2021, 12:51am UTC](https://forums.unrealengine.com/t/ue5-source-code-compilation-error/236764/3 "2021-06-23T00:51:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rdtg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rdtg](https://forums.unrealengine.com/u/rdtg)\
**Post date:** [June 26, 2021, 5:51pm UTC](https://forums.unrealengine.com/t/ue5-source-code-compilation-error/236764/4 "2021-06-26T17:51:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![deitylink1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@deitylink1](https://forums.unrealengine.com/u/deitylink1)\
**Post date:** [August 11, 2021, 12:02am UTC](https://forums.unrealengine.com/t/ue5-source-code-compilation-error/236764/5 "2021-08-11T00:02:27Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d9f4baab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d9f4baab](https://forums.unrealengine.com/u/anonymous_user_d9f4baab)\
**Post date:** [October 12, 2021, 6:07pm UTC](https://forums.unrealengine.com/t/ue5-source-code-compilation-error/236764/6 "2021-10-12T18:07:28Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![0xcdafd0f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@0xcdafd0f1](https://forums.unrealengine.com/u/0xcdafd0f1)\
**Post date:** [November 29, 2021, 1:51am UTC](https://forums.unrealengine.com/t/ue5-source-code-compilation-error/236764/7 "2021-11-29T01:51:10Z")

</div>

Thank you @deitylink1 and @anonymous_user_d9f4baab 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.
