# Unreal Engine 4.25 source code compile error

**URL:** <https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849>\
**Category:** C++\
**Tags:** unreal-engine, Engine-Source-Code\
**Created:** [April 20, 2020, 5:19am UTC](https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849 "2020-04-20T05:19:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Di-Shiper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Di-Shiper](https://forums.unrealengine.com/u/Di-Shiper)\
**Post date:** [April 20, 2020, 5:19am UTC](https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849/1 "2020-04-20T05:19:08Z")

</div>

When trying to build a version 4.25 engine, this error is issued:

Severity Code Description Project File Line Suppression State  
Error MSB4018 The “SetEnv” task failed unexpectedly.  
System.ArgumentException: Environment variable name or value is too long.  
at System.Environment.SetEnvironmentVariable(String variable, String value)  
at System.Environment.SetEnvironmentVariable(String variable, String value, EnvironmentVariableTarget target)  
at Microsoft.Build.CPPTasks.SetEnv.Execute()  
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()  
at Microsoft.Build.BackEnd.TaskBuilder.\<ExecuteInstantiatedTask\>d\_\_26.MoveNext() UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.Current.targets 82

How can this be solved?

---

<div class="post-metadata">

**Author:** ![Di-Shiper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Di-Shiper](https://forums.unrealengine.com/u/Di-Shiper)\
**Post date:** [April 20, 2020, 6:57am UTC](https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849/2 "2020-04-20T06:57:21Z")

</div>

Solved. Simply deleted the paths to the inclusions, since there were strange paths in them.

 ![43545.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/6/e6d47706532b8dcce30154fbe481f3310e40f6a7.png)

---

<div class="post-metadata">

**Author:** ![metablaster](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/metablaster/32/631348_2.png) [@metablaster](https://forums.unrealengine.com/u/metablaster)\
**Post date:** [April 20, 2020, 4:57pm UTC](https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849/3 "2020-04-20T16:57:43Z")

</div>

Interesting finding, I had the same problem on “promoted” branch and switched to another.

thank you for sharing, it should be helpful to know where to look for next errors.  
what branch are you using for source build?

---

<div class="post-metadata">

**Author:** ![OptimisticMonkey](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/optimisticmonkey/32/906571_2.png) [@OptimisticMonkey](https://forums.unrealengine.com/u/OptimisticMonkey)\
**Post date:** [June 27, 2022, 1:06pm UTC](https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849/5 "2022-06-27T13:06:11Z")

</div>

Thanks for Posting - this fixed the issue for me.

---

<div class="post-metadata">

**Author:** ![Megatron.THX](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/megatron.thx/32/707762_2.png) [@Megatron.THX](https://forums.unrealengine.com/u/Megatron.THX)\
**Post date:** [July 8, 2023, 3:54pm UTC](https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849/6 "2023-07-08T15:54:14Z")

</div>

Thanks @Di-Shiper this worked for me using the last ue5\_main version from github today.

---

<div class="post-metadata">

**Author:** ![CodeWithDerrick](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CodeWithDerrick](https://forums.unrealengine.com/u/CodeWithDerrick)\
**Post date:** [November 20, 2025, 5:13pm UTC](https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849/7 "2025-11-20T17:13:27Z")

</div>

For anyone else hitting this and confused where it is:  
Within your solution explorer inside visual studio, open the engine directory, right click UE5 → Properties at the very bottom

---

<div class="post-metadata">

**Author:** ![deric.an](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@deric.an](https://forums.unrealengine.com/u/deric.an)\
**Post date:** [March 21, 2026, 7:44am UTC](https://forums.unrealengine.com/t/unreal-engine-4-25-source-code-compile-error/141849/8 "2026-03-21T07:44:54Z")

</div>

thank you soooooooo much~
