# Errors Building UE5.2 and 5.2 Preview-1

**URL:** <https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605>\
**Category:** Platform & Builds\
**Tags:** source-build, unreal-engine\
**Created:** [February 21, 2023, 3:43pm UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605 "2023-02-21T15:43:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel\_Paiva\_H](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gabriel_paiva_h/32/465774_2.png) [@Gabriel\_Paiva\_H](https://forums.unrealengine.com/u/Gabriel_Paiva_H)\
**Post date:** [February 21, 2023, 3:43pm UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605/1 "2023-02-21T15:43:20Z")

</div>

Hello, am getting two FAILS at building the source for 5.2.  
Mainly Unsync and UE5ProgramRules.

Unsync.vcxproj  
Fails like this:

```auto
Build started...
16>Building Unsync...
6>Using Visual Studio 2022 14.34.31942 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933) and Windows 10.0.22000.0 SDK (C:\Program Files (x86)\Windows Kits\10).
6>Determining max actions to execute in parallel (8 physical cores, 16 logical cores)
6> Executing up to 8 processes, one per physical core
6>Building 3 actions with 3 processes...
6>[1/3] Link [x64] unsync.exe cancelled
6>[2/3] WriteMetadata unsync.target cancelled
6>[3/3] Compile [x64] UnsyncCore.cpp
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat Unsync Win64 Development -WaitMutex -FromMsBuild" exited with code 6.
6>Done building project "Unsync.vcxproj" -- FAILED.

```

And UE5ProgramRules reports an error in ShaderCompileWorker.Build.cs line 35:  
RuntimeDependencies.Add(DirectX.GetDllDir(Target) + “d3dcompiler\_47.dll”);  
as the name "DirectX"does not exist in current content.

I have been building UE5 source since 5.0 and this is the first time I get this, can someone please help me?

Am wondering if it is VS 2022 Version 17.4.5?  
Ohh and am trying to build in Win11

---

<div class="post-metadata">

**Author:** ![The-JL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@The-JL](https://forums.unrealengine.com/u/The-JL)\
**Post date:** [February 24, 2023, 11:57am UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605/2 "2023-02-24T11:57:11Z")

</div>

I am having the exact same build error on the current 5.1.1 release branch using VS 2022 Version 17.4.4 and using Win10. Every other project compiled successfully. I’m going to try and start commenting out function bodies to see if I can track it down.

---

<div class="post-metadata">

**Author:** ![PhDittmann](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/phdittmann/32/770669_2.png) [@PhDittmann](https://forums.unrealengine.com/u/PhDittmann)\
**Post date:** [March 1, 2023, 4:06pm UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605/3 "2023-03-01T16:06:38Z")

</div>

We tried to build UE5.2 and got the same errors.

- OS: Win10 and Win11
- Visual Studio Enterprise 2022 17.5.1
- Windows 10.0.22621.0 SDK

For the DirectX error we used the hotfix reverting `Engine\Source\Programs\ShaderCompileWorker\ShaderCompilerWorker.Build.cs`. Otherwise replace line 34 with  
`RuntimeDependencies.Add(Path.Combine(Target.RelativeEnginePath, "Binaries/ThirdParty/Windows/DirectX/x64/d3dcompiler_47.dll"));`  
Somehow `Engine\Source\ThirdParty\Windows\DirectX\DirectX.Build.cs` is not loaded.

For Unsync we could track it down to `Engine\Source\Programs\Unsync\Private\UnsyncCore.cpp`. You can either comment lines 486-489, which removes all uses of the template ComputeBlocksVariableT and obviously functionality

> **UnsyncCore.cpp:486-489**
>
> ```auto
> //case EWeakHashAlgorithmID::Naive:
> //	return ComputeBlocksVariableT<FRollingChecksum>(Reader, BlockSize, StrongHasher, OutMacroBlocks);
> //case EWeakHashAlgorithmID::BuzHash:
> //	return ComputeBlocksVariableT<FBuzHash>(Reader, BlockSize, StrongHasher, OutMacroBlocks);
> 
> ```

or inside ComputeBlocksVariableT you can comment lines 301, 306-376.

> **UnsyncCore.cpp:299-376**
>
> ```auto
> FGenericBlock CurrentMacroBlock;
> CurrentMacroBlock.HashStrong.Type = EHashType::Blake3_160;
> //CurrentMacroBlock.Offset = Task.Offset;
> 
> blake3_hasher MacroBlockHasher;
> blake3_hasher_init(&MacroBlockHasher);
> 
> /*auto ScanFn =
> [MacroBlockHashThreshold,
> MaximumMacroBlockSize,
> MaximumBlockSize,
> MinimumMacroBlockSize,
> DataEnd,
> &LastBlockEnd,
> &Task,
> DataBegin,
> StrongHasher,
> TargetMacroBlockSize,
> &MacroBlockHasher,
> &CurrentMacroBlock](const uint8* WindowBegin, const uint8* WindowEnd, uint32 WindowHash)
> UNSYNC_ATTRIB_FORCEINLINE {
> // WARNING: Changing this invalidates some of the previously cached blocks.
> // TODO: compute based on target average block size
> const uint32 ChunkWindowHashThreshold = 0x20000;
> 
> const bool bLastBlock = WindowEnd == DataEnd;
> const uint64 ThisBlockSize = uint64(WindowEnd - LastBlockEnd);
> 
> if (ThisBlockSize >= MaximumBlockSize || WindowHash < ChunkWindowHashThreshold || bLastBlock)
> {
> FGenericBlock Block;
> Block.Offset = Task.Offset + uint64(LastBlockEnd - DataBegin);
> Block.Size = CheckedNarrow(ThisBlockSize);
> Block.HashWeak = WindowHash;
> Block.HashStrong = ComputeHash(LastBlockEnd, ThisBlockSize, StrongHasher);
> 
> if (TargetMacroBlockSize)
> {
> blake3_hasher_update(&MacroBlockHasher, LastBlockEnd, ThisBlockSize);
> CurrentMacroBlock.Size += Block.Size;
> 
> uint32 HashStrong32 = 0;
> memcpy(&HashStrong32, Block.HashStrong.Data, 4);
> 
> if ((CurrentMacroBlock.Size >= MinimumMacroBlockSize && HashStrong32 < MacroBlockHashThreshold) ||
> (CurrentMacroBlock.Size + Block.Size > MaximumMacroBlockSize) || bLastBlock)
> {
> // Commit the macro block
> blake3_hasher_finalize(&MacroBlockHasher,
> CurrentMacroBlock.HashStrong.Data,
> sizeof(CurrentMacroBlock.HashStrong.Data));
> Task.MacroBlocks.push_back(CurrentMacroBlock);
> 
> // Reset macro block state
> blake3_hasher_init(&MacroBlockHasher);
> CurrentMacroBlock.Offset += CurrentMacroBlock.Size;
> CurrentMacroBlock.Size = 0;
> }
> }
> 
> if (!Task.Blocks.empty())
> {
> UNSYNC_ASSERT(Task.Blocks.back().Offset + Task.Blocks.back().Size == Block.Offset);
> }
> 
> Task.Blocks.push_back(Block);
> 
> LastBlockEnd = WindowEnd;
> 
> return true;
> }
> else
> {
> return false;
> }
> };
> 
> HashScan<WeakHasher>(DataBegin, ThisTaskSize, MinimumBlockSize, ScanFn);*/
> 
> ```

Maybe it helps to identify the real issue.

EDIT:

It’s a name conflict between `struct Task` (line 245) and the local variable task (lines 293ff). You can either rename the structure to i.e. `struct TaskBlocks` (lines 245, 252, 392, 403), or rename the local variable to i.e. `_Task` (lines 293-364).

EDIT2:

Since Feb 21 2023 it’s already fixed in ue5-main branch: [https://github.com/EpicGames/UnrealEngine/commit/f89d532f0845007b8cf0d2d3d71b8fb9eccfebc4](https://github.com/EpicGames/UnrealEngine/commit/f89d532f0845007b8cf0d2d3d71b8fb9eccfebc4).

---

<div class="post-metadata">

**Author:** ![Durrik1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Durrik1](https://forums.unrealengine.com/u/Durrik1)\
**Post date:** [May 14, 2023, 4:54am UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605/4 "2023-05-14T04:54:14Z")

</div>

Both errors still exist as of 5.2.0 Release and commit 407acc04a93f09ecb42c07c98b74fd00cc967100.

But thanks for the fixes, it took a while before I found this thread and I now have 5.2.0 release working.

I choose to rename the local variable (Ctrl-R-R is such a beautiful thing).

---

<div class="post-metadata">

**Author:** ![chrisaverage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chrisaverage](https://forums.unrealengine.com/u/chrisaverage)\
**Post date:** [May 29, 2023, 7:13am UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605/5 "2023-05-29T07:13:42Z")

</div>

The 5.2.0 release is missing the DirectX project build file.  
Get it from Github and place in:

```auto
.../Engine/Source/ThirdParty/Windows/DirectX/DirectX.Build.cs

```

---

<div class="post-metadata">

**Author:** ![J.C.Smith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@J.C.Smith](https://forums.unrealengine.com/u/J.C.Smith)\
**Post date:** [May 30, 2023, 3:24pm UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605/6 "2023-05-30T15:24:43Z")

</div>

Get it from where?

---

<div class="post-metadata">

**Author:** ![Kjasi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kjasi/32/690676_2.png) [@Kjasi](https://forums.unrealengine.com/u/Kjasi)\
**Post date:** [May 30, 2023, 7:00pm UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605/7 "2023-05-30T19:00:59Z")

</div>

If you’re missing that file (I wasn’t) you’ll need to get access to the Epic Games GitHub, as described [here](https://www.unrealengine.com/en-US/ue-on-github). You can then download the source as a ZIP file, or clone it locally. You’ll then have the missing file.

@PhDittmann Thank you for the edits! This issue made it to the 5.2.0 Release, so I’m trying those changes now!

---

<div class="post-metadata">

**Author:** ![SupremeMaximus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupremeMaximus](https://forums.unrealengine.com/u/SupremeMaximus)\
**Post date:** [July 12, 2023, 10:12pm UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605/8 "2023-07-12T22:12:12Z")

</div>

> [@PhDittmann](#):
>
> We tried to build UE5.2 and got the same errors.
> 
> - OS: Win10 and Win11
> - Visual Studio Enterprise 2022 17.5.1
> - Windows 10.0.22621.0 SDK
> 
> For the DirectX error we used the hotfix reverting `Engine\Source\Programs\ShaderCompileWorker\ShaderCompilerWorker.Build.cs`. Otherwise replace line 34 with  
> `RuntimeDependencies.Add(Path.Combine(Target.RelativeEnginePath, "Binaries/ThirdParty/Windows/DirectX/x64/d3dcompiler_47.dll"));`  
> Somehow `Engine\Source\ThirdParty\Windows\DirectX\DirectX.Build.cs` is not loaded.
> 
> For Unsync we could track it down to `Engine\Source\Programs\Unsync\Private\UnsyncCore.cpp`. You can either comment lines 486-489, which removes all uses of the template ComputeBlocksVariableT and obviously functionality
> 
> UnsyncCore.cpp:486-489
> 
> ```auto
> //case EWeakHashAlgorithmID::Naive:
> //	return ComputeBlocksVariableT<FRollingChecksum>(Reader, BlockSize, StrongHasher, OutMacroBlocks);
> //case EWeakHashAlgorithmID::BuzHash:
> //	return ComputeBlocksVariableT<FBuzHash>(Reader, BlockSize, StrongHasher, OutMacroBlocks);
> 
> ```
> 
> or inside ComputeBlocksVariableT you can comment lines 301, 306-376.
> 
> UnsyncCore.cpp:299-376
> 
> ```auto
> FGenericBlock CurrentMacroBlock;
> CurrentMacroBlock.HashStrong.Type = EHashType::Blake3_160;
> //CurrentMacroBlock.Offset = Task.Offset;
> 
> blake3_hasher MacroBlockHasher;
> blake3_hasher_init(&MacroBlockHasher);
> 
> /*auto ScanFn =
> [MacroBlockHashThreshold,
> MaximumMacroBlockSize,
> MaximumBlockSize,
> MinimumMacroBlockSize,
> DataEnd,
> &LastBlockEnd,
> &Task,
> DataBegin,
> StrongHasher,
> TargetMacroBlockSize,
> &MacroBlockHasher,
> &CurrentMacroBlock](const uint8* WindowBegin, const uint8* WindowEnd, uint32 WindowHash)
> UNSYNC_ATTRIB_FORCEINLINE {
> // WARNING: Changing this invalidates some of the previously cached blocks.
> // TODO: compute based on target average block size
> const uint32 ChunkWindowHashThreshold = 0x20000;
> 
> const bool bLastBlock = WindowEnd == DataEnd;
> const uint64 ThisBlockSize = uint64(WindowEnd - LastBlockEnd);
> 
> if (ThisBlockSize >= MaximumBlockSize || WindowHash < ChunkWindowHashThreshold || bLastBlock)
> {
> FGenericBlock Block;
> Block.Offset = Task.Offset + uint64(LastBlockEnd - DataBegin);
> Block.Size = CheckedNarrow(ThisBlockSize);
> Block.HashWeak = WindowHash;
> Block.HashStrong = ComputeHash(LastBlockEnd, ThisBlockSize, StrongHasher);
> 
> if (TargetMacroBlockSize)
> {
> blake3_hasher_update(&MacroBlockHasher, LastBlockEnd, ThisBlockSize);
> CurrentMacroBlock.Size += Block.Size;
> 
> uint32 HashStrong32 = 0;
> memcpy(&HashStrong32, Block.HashStrong.Data, 4);
> 
> if ((CurrentMacroBlock.Size >= MinimumMacroBlockSize && HashStrong32 < MacroBlockHashThreshold) ||
> (CurrentMacroBlock.Size + Block.Size > MaximumMacroBlockSize) || bLastBlock)
> {
> // Commit the macro block
> blake3_hasher_finalize(&MacroBlockHasher,
> CurrentMacroBlock.HashStrong.Data,
> sizeof(CurrentMacroBlock.HashStrong.Data));
> Task.MacroBlocks.push_back(CurrentMacroBlock);
> 
> // Reset macro block state
> blake3_hasher_init(&MacroBlockHasher);
> CurrentMacroBlock.Offset += CurrentMacroBlock.Size;
> CurrentMacroBlock.Size = 0;
> }
> }
> 
> if (!Task.Blocks.empty())
> {
> UNSYNC_ASSERT(Task.Blocks.back().Offset + Task.Blocks.back().Size == Block.Offset);
> }
> 
> Task.Blocks.push_back(Block);
> 
> LastBlockEnd = WindowEnd;
> 
> return true;
> }
> else
> {
> return false;
> }
> };
> 
> HashScan<WeakHasher>(DataBegin, ThisTaskSize, MinimumBlockSize, ScanFn);*/
> 
> ```
> 
> Maybe it helps to identify the real issue.
> 
> EDIT:
> 
> It’s a name conflict between `struct Task` (line 245) and the local variable task (lines 293ff). You can either rename the structure to i.e. `struct TaskBlocks` (lines 245, 252, 392, 403), or rename the local variable to i.e. `_Task` (lines 293-364).
> 
> EDIT2:
> 
> Since Feb 21 2023 it’s already fixed in ue5-main branch: [https://github.com/EpicGames/UnrealEngine/commit/f89d532f0845007b8cf0d2d3d71b8fb9eccfebc4](https://github.com/EpicGames/UnrealEngine/commit/f89d532f0845007b8cf0d2d3d71b8fb9eccfebc4).

Thanks for the fixes. These errors still exists in 5.2.1

---

<div class="post-metadata">

**Author:** ![zetarus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zetarus](https://forums.unrealengine.com/u/zetarus)\
**Post date:** [August 2, 2023, 9:34pm UTC](https://forums.unrealengine.com/t/errors-building-ue5-2-and-5-2-preview-1/775605/9 "2023-08-02T21:34:05Z")

</div>

Thank you!
