(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”
[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.
Settings.MeanDelta = FMath::Clamp(Settings.MeanDelta, 1e-6f, INFINITY); (PieakPicker.cpp, line 17)
Here is how INFINITY is defined in corecrt_math.h
#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
./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.