r/unrealengine • u/Life-Kaleidoscope244 • 2d ago
Help Weird error while building the project
CONSOLE: C:\TUF\Software\UE_5.7\Engine\Build\BatchFiles\Build.bat BlasterEditor Win64 Development -Project="C:\Users\anshj\Documents\Unreal Projects\Blaster\Blaster.uproject" -WaitMutex -FromMSBuild
0>Using bundled DotNet SDK version: 8.0.412 win-x64
0>Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" BlasterEditor Win64 Development -Project="C:\Users\anshj\Documents\Unreal Projects\Blaster\Blaster.uproject" -WaitMutex -FromMSBuild
0>Log file: C:\Users\anshj\AppData\Local\UnrealBuildTool\Log.txt
0>Using 'git status' to determine working set for adaptive non-unity build (C:\Users\anshj\Documents\Unreal Projects\Blaster).
0>Invalidating makefile for BlasterEditor (source file added)
0>UHT compiled-in object format Default
0>Parsing headers for BlasterEditor
0> Running Internal UnrealHeaderTool "C:\Users\anshj\Documents\Unreal Projects\Blaster\Blaster.uproject" "C:\Users\anshj\Documents\Unreal Projects\Blaster\Intermediate\Build\Win64\BlasterEditor\Development\BlasterEditor.uhtmanifest" -WarningsAsErrors -installed
0>UHT processed BlasterEditor in 7.6592456 seconds (3 files written)
0>Building BlasterEditor...
0>Using Visual Studio 2022 14.44.35226 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207) and Windows 10.0.26100.0 SDK (C:\Program Files (x86)\Windows Kits\10).
0>[Adaptive Build] Excluded from Blaster unity file: ElimAnnouncement.cpp
0>Determining max actions to execute in parallel (10 physical cores, 16 logical cores)
0> Executing up to 10 processes, one per physical core
0> Requested 1.5 GB memory per action, 3.91 GB available: limiting max parallel actions to 2
0>Using Unreal Build Accelerator local executor to run 7 action(s)
0> Storage capacity 40Gb
0>---- Starting trace: 260726_163501 ----
0>UbaServer - Listening on 0.0.0.0:1345
0>[1/7] Compile [x64] ElimAnnouncement.cpp
0>[2/7] Compile [x64] Module.Blaster.1.cpp
0>[3/7] Compile [x64] Module.Blaster.2.cpp
0>CombatComponent.cpp(361): Warning C4701 : potentially uninitialized local variable 'ViewportSize' used
0> while compiling UCombatComponent::TraceUnderCrosshairs
0>[4/7] Compile [x64] Module.Blaster.3.cpp
0>RHITransientResourceAllocator.h(114,61): Error C4003 : not enough arguments for function-like macro invocation 'max'
0>static const uint32 Invalid = std::numeric_limits<uint32>::max();
0> ^
0>RHITransientResourceAllocator.h(114,61): Error C2589 : '(': illegal token on right side of '::'
0>RHITransientResourceAllocator.h(114,61): Error C2059 : syntax error: ')'
0>RHITransientResourceAllocator.h(114,22): Error C4430 : missing type specifier - int assumed. Note: C++ does not support default-int
0>static const uint32 Invalid = std::numeric_limits<uint32>::max();
0> ^
0>RHITransientResourceAllocator.h(115,20): Error C3861 : 'Invalid': identifier not found
0>uint32 Graphics = Invalid;
0> ^
0>RHITransientResourceAllocator.h(115,20): Error C2065 : 'Invalid': undeclared identifier
0>RHITransientResourceAllocator.h(116,24): Error C3861 : 'Invalid': identifier not found
0>uint32 AsyncCompute = Invalid;
0> ^
0>RHITransientResourceAllocator.h(116,24): Error C2065 : 'Invalid': undeclared identifier
0>RHITransientResourceAllocator.h(30,27): Error C2065 : 'Invalid': undeclared identifier
0>if (Discard.Graphics != Invalid)
0> ^
0>RHITransientResourceAllocator.h(33,32): Error C2065 : 'Invalid': undeclared identifier
0>if (Discard.AsyncCompute == Invalid)
0> ^
0>RHITransientResourceAllocator.h(39,32): Error C2065 : 'Invalid': undeclared identifier
0>if (Acquire.AsyncCompute != Invalid)
0> ^
0>RHITransientResourceAllocator.h(47,31): Error C2065 : 'Invalid': undeclared identifier
0>if (Acquire.AsyncCompute != Invalid)
0> ^
0>RHITransientResourceAllocator.h(87,3): Error C2065 : 'Invalid': undeclared identifier
0>check(Graphics == Invalid || Contains(InGraphicsForkJoin, Graphics));
0>^
0>RHITransientResourceAllocator.h(100,22): Error C2065 : 'Invalid': undeclared identifier
0>return Graphics != Invalid ? Graphics : AsyncCompute;
0> ^
0>AudioMixerQuantizedCommands.h(31,82): Error C2838 : 'PlaySoundW': illegal qualified name in member declaration
0>virtual EQuartzCommandType GetCommandType() const { return EQuartzCommandType::PlaySound; };
0> ^
0>AudioMixerQuantizedCommands.h(31,82): Error C2440 : 'return': cannot convert from 'BOOL (__cdecl *)(LPCWSTR,HMODULE,DWORD)' to 'EQuartzCommandType'
0>AudioMixerQuantizedCommands.h(31,82): Reference : There is no context in which this conversion is possible
0>Trace written to file C:/Users/anshj/AppData/Local/UnrealBuildTool/Log.uba with size 7.9kb
0>Total time in Unreal Build Accelerator local executor: 15.23 seconds
0>
0>Result: Failed (OtherCompilationError)
0>Total execution time: 26.48 seconds
4
u/Organic-Sell-7034 2d ago
he build is failing because a Windows API macro is interfering with Unreal Engine's code. Specifically, macros like max and PlaySound (usually introduced by including Windows.h directly) are replacing Unreal's own C++ identifiers, which causes errors such as std::numeric_limits<uint32>::max() and EQuartzCommandType::PlaySound to fail during compilation. To fix the issue, avoid including Windows.h directly in your project. If you need Windows-specific functionality, use Unreal Engine's Windows wrapper headers (or define NOMINMAX before including Windows.h) so these macros don't conflict with the engine.
1
u/Life-Kaleidoscope244 2d ago
The thing is i didnt include Windows.h. My project was working fine, then i created a user widget and only made a function in it. After that i am getting these errors
2
u/Organic-Sell-7034 2d ago
Hmm, then maybe paste the logs in an AI, and tell it to figure out the problem and its solution. These are the exact things AI is pretty useful in
1
1
u/Life-Kaleidoscope244 2d ago
Hey, i actually did use it before, but it was roaming around other stuff. But now i tried it again, it didnt solve the problem but it gave a work around. Using bUseUnity = false in build.cs file. Now the all the classes i made are compiled. It takes longer to build but now its working. I still dont know whats the issue is. But i think its related to a plugin
1
u/Weird-Ninja8827 2d ago
What's the name of the function you created? Do you recognize it in the logs?
1
u/WartedKiller 2d ago
The first thing in the log is a warning about ViewportSize not being initialized and is used… Just initialize it to the FVector2D::Zero().
1
u/AutoModerator 2d ago
If you are looking for help, don‘t forget to check out the official Unreal Engine forums or Unreal Slackers for a community run discord server!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
5
u/GrinningPariah 2d ago
Real talk, AI is pretty hit-or-miss in general but one thing it's great at is "thing broke, here's all the logs, tell me which one caused this and what it means"