# Getting "error C4756: overflow in constant arithmetic" while building Unreal 5.4.2 from source code

**URL:** <https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276>\
**Category:** Getting Started & Setup\
**Tags:** source-build, unreal-engine, Engine-Source-Code\
**Created:** [June 10, 2024, 8:08am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276 "2024-06-10T08:08:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![balikamca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@balikamca](https://forums.unrealengine.com/u/balikamca)\
**Post date:** [June 10, 2024, 8:08am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/1 "2024-06-10T08:08:21Z")

</div>

(Please also read the 2nd message, most probably it is related to installing Windows SDK)  
I was able to build Unreal engine from source code previously. After some time, I tried again with Unreal 5.4.2 version with VS 2022. It compiled almost all of the files, however I received several errors saying:  
“error C4756: overflow in constant arithmetic”

```auto
[1/387] Compile [x64] Module.AudioSynesthesiaCore.cpp
PATH\Engine\Plugins\Runtime\AudioSynesthesia\Source\AudioSynesthesiaCore\Private\PeakPicker.cpp(17) : error C4756: overflow in constant arithmetic
   while compiling Audio::FPeakPicker::FPeakPicker
[2/387] Compile [x64] Module.RenderCore.2.cpp
PATH\Engine\Source\Runtime\RenderCore\Private\RenderGraphPrivate.cpp(196) : error C4756: overflow in constant arithmetic
   while compiling GetClobberValue
[3/387] Compile [x64] Module.LiveLink.cpp
PATH\Engine\Plugins\Animation\LiveLink\Source\LiveLink\Private\LiveLinkClient.cpp(1728) : error C4756: overflow in constant arithmetic
   while compiling FLiveLinkClient_Base_DEPRECATED::PushSubjectData
[4/387] Compile [x64] Module.PoseSearch.3.cpp
PATH\Engine\Plugins\Animation\PoseSearch\Source\Runtime\Private\PoseSearchLibrary.cpp(134) : error C4756: overflow in constant arithmetic
   while compiling FMotionMatchingState::Reset

```

When I check the source code, I see it is related to macro definition of INFINITY and storing that value within float typed variables.

[https://github.com/EpicGames/UnrealEngine/blob/c830445187784f1269f43b56f095493a27d5a636/Engine/Plugins/Animation/LiveLink/Source/LiveLink/Private/LiveLinkClient.cpp#L1728](https://github.com/EpicGames/UnrealEngine/blob/c830445187784f1269f43b56f095493a27d5a636/Engine/Plugins/Animation/LiveLink/Source/LiveLink/Private/LiveLinkClient.cpp#L1728)

[Settings.MeanDelta = FMath::Clamp(Settings.MeanDelta, 1e-6f, INFINITY); (PieakPicker.cpp, line 17)](https://github.com/EpicGames/UnrealEngine/blob/c830445187784f1269f43b56f095493a27d5a636/Engine/Plugins/Runtime/AudioSynesthesia/Source/AudioSynesthesiaCore/Private/PeakPicker.cpp#L17)

[https://github.com/EpicGames/UnrealEngine/blob/c830445187784f1269f43b56f095493a27d5a636/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp#L196](https://github.com/EpicGames/UnrealEngine/blob/c830445187784f1269f43b56f095493a27d5a636/Engine/Source/Runtime/RenderCore/Private/RenderGraphPrivate.cpp#L196)

Here is how INFINITY is defined in corecrt\_math.h

```auto
#ifndef _HUGE_ENUF
    #define _HUGE_ENUF 1e+300 // _HUGE_ENUF*_HUGE_ENUF must overflow
#endif

#define INFINITY ((float)(_HUGE_ENUF * _HUGE_ENUF))

```

My build process is like that:

`./GenerateProjectFiles.bat -2022`

```auto
          ./Engine/Build/BatchFiles/RunUAT.bat BuildGraph `
            -script="Engine/Build/InstalledEngineBuild.xml" `
            -target="Make Installed Build Win64" `
            -set:HostPlatformOnly=true `
            -set:GameConfigurations="" `
            -set:WithFullDebugInfo=false `
            -set:WithDDC=false `
            -set:SignExecutables=false

```

I was able to compile like that some times ago, but unfortunately not this time.

I want to learn why I got these errors and what is the solution?

Thanks.

---

<div class="post-metadata">

**Author:** ![balikamca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@balikamca](https://forums.unrealengine.com/u/balikamca)\
**Post date:** [June 10, 2024, 8:22am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/2 "2024-06-10T08:22:37Z")

</div>

I have additional feedback. I have another build pipeline which was working fine but it also started giving errors…

Recently I installed [Windows SDK - Windows app development | Microsoft Developer](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) version 10.0.26100.1 because Unreal Build process was complaining about pdbcopy.exe being missing and it guided me to install Windows 10 SDK.

After installing Windows 10 SDK 10.0.26100.1 from the link above, my builds started giving error.

---

<div class="post-metadata">

**Author:** ![AugustoNalin\_SE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AugustoNalin\_SE](https://forums.unrealengine.com/u/AugustoNalin_SE)\
**Post date:** [June 10, 2024, 10:46am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/3 "2024-06-10T10:46:24Z")

</div>

same issue here

---

<div class="post-metadata">

**Author:** ![KSShreyas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KSShreyas](https://forums.unrealengine.com/u/KSShreyas)\
**Post date:** [June 10, 2024, 11:34pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/4 "2024-06-10T23:34:23Z")

</div>

Same stuff here as well. I would also like to know a solution to this.

---

<div class="post-metadata">

**Author:** ![balikamca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@balikamca](https://forums.unrealengine.com/u/balikamca)\
**Post date:** [June 11, 2024, 7:33am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/5 "2024-06-11T07:33:25Z")

</div>

Hi.  
As I mentioned in the first 2 messages, my problem was related to Windows SDK version because INFINITY is defined in the headers coming by SDK package. Either there is a problem with the newest SDK version or we installed an incorrect version of the SDK (like Windows 11 SDK to Windows 10 SDK, just speculating)

The solution for me is to Uninstall the most recent version (10.0.26100.1) and installing “Windows SDK for Windows 11 (10.0.22621.755)”

The SDK archive can be found in this page: [Windows SDK and emulator archive | Microsoft Developer](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/)

---

<div class="post-metadata">

**Author:** ![Trout\_Zhang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Trout\_Zhang](https://forums.unrealengine.com/u/Trout_Zhang)\
**Post date:** [June 21, 2024, 10:44am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/6 "2024-06-21T10:44:42Z")

</div>

Same here, 5.4.2 with latest vs2022 17.10.3. I’ve ticked both win 11 sdk 10.0.22621.0 and 10.0.26100.0 in the vs installer, hence lots of C4756.

Thanks to @balikamca Untick 10.0.26100.0 fixed the issue.

---

<div class="post-metadata">

**Author:** ![Trout\_Zhang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Trout\_Zhang](https://forums.unrealengine.com/u/Trout_Zhang)\
**Post date:** [June 21, 2024, 11:12am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/7 "2024-06-21T11:12:55Z")

</div>

Before remove 26100(the win11 sdk for 24H2 later this year), I tried replace INFINITY macro with both std::numeric\_limits::infinity() and it’s ultimate calling builtin function of \_\_builtin\_huge\_valf(), they both worked.

---

<div class="post-metadata">

**Author:** ![L0Heek11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@L0Heek11](https://forums.unrealengine.com/u/L0Heek11)\
**Post date:** [June 21, 2024, 6:58pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/8 "2024-06-21T18:58:19Z")

</div>

Thanks for the advice, it works for me by replacing for each error (4 or 5) INFINITY with **std::numeric\_limits\<float\>::infinity()**

---

<div class="post-metadata">

**Author:** ![Deliverator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deliverator](https://forums.unrealengine.com/u/Deliverator)\
**Post date:** [June 21, 2024, 8:42pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/9 "2024-06-21T20:42:54Z")

</div>

I’m still getting the error on my project, unfortunately.

Not only that, but I removed and reinstalled VS 2022 and my UE 5.2 github repository, then attempted to build and have the same error.

The error occurs building UE with VS and building my project with UGS.

ubt\> [5/184] Compile [x64] Module.AudioSynesthesiaCore.cpp  
ubt\> D:\p4\lunacy\main\UnrealEngine\Engine\Plugins\Runtime\AudioSynesthesia\Source\AudioSynesthesiaCore\Private\PeakPicker.cpp(17) : error C4756: overflow in constant arithmetic  
ubt\> [6/184] Link [x64] UnrealEditor-AudioSynesthesiaCore.dll cancelled  
ubt\> [7/184] Compile [x64] Module.RenderCore.2\_of\_5.cpp  
ubt\> D:\p4\lunacy\main\UnrealEngine\Engine\Source\Runtime\RenderCore\Private\RenderGraphPrivate.cpp(193) : error C4756: overflow in constant arithmetic

I followed this as closely as possible, though I’m using the Windows 11 SDK our team uses and the UWP setup is different now.

> **[Setting Up Visual Studio Development Environment for C++ Projects in Unreal...](https://dev.epicgames.com/documentation/en-us/unreal-engine/setting-up-visual-studio-development-environment-for-cplusplus-projects-in-unreal-engine?application_version=5.2)**
>
> Tips, tricks, and techniques for setting up Visual Studio to work with Unreal Engine

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/d/f8d8ebb91a2ee71814d0a6a2d504f9af2556de99.png)

My settings match those of our Engineer, which match those of the 5.2 setup article, except for that W11 sdk.

---

<div class="post-metadata">

**Author:** ![Yaegaki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Yaegaki](https://forums.unrealengine.com/u/Yaegaki)\
**Post date:** [June 26, 2024, 3:04am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/10 "2024-06-26T03:04:43Z")

</div>

I’m getting the same error when I build from the ue5-main branch. **Downgrading the Windows SDK to 10.0.18362** solves the problem for me.

This SDK version is mentioned in the setup document, under section " C++ Tools" (link is posted by **deliverator** above). Guess that’s the version most Epic developers are using?

I have previously installed the newest SDK (10.0.26100.0), as it is suggested by Visual Studio when I open the UE5 solution. Turns out I should just ignore that VS popup…

Hope this helps.

---

<div class="post-metadata">

**Author:** ![user\_f9ac4895d89eb4586248ddb488c27da1aca8a52fc17ef9891f9c39](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@user\_f9ac4895d89eb4586248ddb488c27da1aca8a52fc17ef9891f9c39](https://forums.unrealengine.com/u/user_f9ac4895d89eb4586248ddb488c27da1aca8a52fc17ef9891f9c39)\
**Post date:** [June 26, 2024, 12:25pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/11 "2024-06-26T12:25:42Z")

</div>

It works for me too.

---

<div class="post-metadata">

**Author:** ![Danb106632](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Danb106632](https://forums.unrealengine.com/u/Danb106632)\
**Post date:** [June 26, 2024, 10:31pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/12 "2024-06-26T22:31:29Z")

</div>

Getting the same issue, I’ve reinstalled VS and deleted the sdk from my system and downgraded still no luck

---

<div class="post-metadata">

**Author:** ![JavadKouch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JavadKouch](https://forums.unrealengine.com/u/JavadKouch)\
**Post date:** [July 2, 2024, 8:50pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/13 "2024-07-02T20:50:33Z")

</div>

Uninstalling the SDK is not enough, you also have to regenerate your solution file.

I uninstalled 10.0.26100.0 and left only 10.0.18362.0 installed. Beware that the Include directory does not get deleted when you uninstall 10.0.26100.0, so if you don’t regenerate your solution, the old includes will still be referenced and nothing will appear to have changed.

---

<div class="post-metadata">

**Author:** ![glitchered](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/glitchered/32/768299_2.png) [@glitchered](https://forums.unrealengine.com/u/glitchered)\
**Post date:** [July 5, 2024, 6:06pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/14 "2024-07-05T18:06:03Z")

</div>

having the same issue, currently. the usual ■■■■ job by microsoft managing their software updates and sdk version clusterf\*ck. they spam update like crazy every week, but probably untested. unreliable. hmm

so i should get rid of those and compile another 3 hours?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/0/aa0c7c4168394ac13361eca69a070bdaaf548166.png)

will it work? ugh. -\_-

---

<div class="post-metadata">

**Author:** ![Trout\_Zhang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Trout\_Zhang](https://forums.unrealengine.com/u/Trout_Zhang)\
**Post date:** [July 10, 2024, 9:25am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/15 "2024-07-10T09:25:34Z")

</div>

For anyone want to digger further, here are the bug / issue links:

[C4756 related issues in VS 2022 - Developer Community (visualstudio.com)](https://developercommunity.visualstudio.com/t/C4756-related-issues-in-VS-2022/10697767)

And for those of you that have UDN access:  
[C4756 error in compiling UE5.4.2 source code with latest Win11 SDK 26100 (unrealengine.com)](https://udn.unrealengine.com/s/question/0D5QP00000R16gX0AR/c4756-error-in-compiling-ue542-source-code-with-latest-win11-sdk-26100)

---

<div class="post-metadata">

**Author:** ![Trout\_Zhang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Trout\_Zhang](https://forums.unrealengine.com/u/Trout_Zhang)\
**Post date:** [July 10, 2024, 9:30am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/16 "2024-07-10T09:30:54Z")

</div>

Also, other than my early workaround of using **std::numeric\_limits::infinity()**, here’s another workaround to let you specify the SDK version, the buildconfiguration way, so you don’t have to uninstall the latest 26100 for Unreal.

```auto
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
	<WindowsPlatform>
		<WindowsSdkVersion>10.0.22621.0</WindowsSdkVersion>
	</WindowsPlatform>
</Configuration>

```

---

<div class="post-metadata">

**Author:** ![FabrizioAbreu013](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fabrizioabreu013/32/1177204_2.png) [@FabrizioAbreu013](https://forums.unrealengine.com/u/FabrizioAbreu013)\
**Post date:** [September 7, 2024, 2:27am UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/17 "2024-09-07T02:27:56Z")

</div>

Hi @Trout_Zhang ,  
can you explain better how to configure this?  
std::numeric\_limits::infinity()

I didn’t quite understand what should be done, I’m having this problem, I’m using Windows 10,

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/f/2cf22dda4eee422fa399ab4757a151a97e4ee278.png)

I have all of these installed, I don’t know if I should uninstall any of them.

I’m using Unreal 5.3.2

---

<div class="post-metadata">

**Author:** ![elik745ie](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/elik745ie/32/911711_2.png) [@elik745ie](https://forums.unrealengine.com/u/elik745ie)\
**Post date:** [September 7, 2024, 12:04pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/18 "2024-09-07T12:04:21Z")

</div>

That helped me too! THANKS!!!

---

<div class="post-metadata">

**Author:** ![FabrizioAbreu013](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fabrizioabreu013/32/1177204_2.png) [@FabrizioAbreu013](https://forums.unrealengine.com/u/FabrizioAbreu013)\
**Post date:** [September 7, 2024, 4:12pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/19 "2024-09-07T16:12:27Z")

</div>

Hi @elik745ie , can you explain in more detail what you did to resolve it?

Thanks!

---

<div class="post-metadata">

**Author:** ![FabrizioAbreu013](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fabrizioabreu013/32/1177204_2.png) [@FabrizioAbreu013](https://forums.unrealengine.com/u/FabrizioAbreu013)\
**Post date:** [September 7, 2024, 7:31pm UTC](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276/20 "2024-09-07T19:31:47Z")

</div>

I had the same problem. (my VS is in Portuguese)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/c/55cb95594b3011a999cbcc7cf54fa9d04fee21d4.png)

After that, I checked which SDKs I had installed and removed the ones that seemed unnecessary, leaving it like that.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/b/d0b594fddc9c43088801e9ef7c4685af8c64cf99.png)

The list to know which SDKs I should use, I found in this manual.

> **[Unreal Engine 5.4 Release Notes | Unreal Engine 5.4 Documentation | Epic...](https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-engine-5.3-release-notes?application_version=5.3)**
>
> Overview of new and updated features in Unreal Engine 5.4

Filter by: platform sdk upgrades  
And it will tell you which SDKs are recommended.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/c/48cb11c69136dc586fed7862948958e83ac90f34.jpeg)

After that, I opened VS, and in my project I right-clicked and selected Clean.

After that, I recompiled normally, without any errors.

[Next page](https://forums.unrealengine.com/t/getting-error-c4756-overflow-in-constant-arithmetic-while-building-unreal-5-4-2-from-source-code/1897276.md?page=2)
