Unable to build fresh Unreal clone on VS2022

Building Unreal after forking and cloning the release, running Setup.bat and GenerateProjectFiles.bat causes 2 errors in VS2022.

The first is C++ being strict about naming local variables the same as member variables in ChaosUserDataPT.h (line 154):

if (const FPhysicsSolverBase* Solver = this->GetSolver())

Renaming Solver fixes this.

The 2nd is that DequeTest.cpp fails to build due to not knowing the definition of the CHECK macro. I am not sure how to fix this.

1 Like

On further investigation it seems like DequeTest.cpp is compiled many times (WHY?? No wonder Unreal takes so long to build!) but only on ONE occasion (building LowLevelTests) CHECK is not defined. The #if logic in TestHarness.h has a loophole in it such that the various testing macros are not defined.

Could it be when WITH_LOW_LEVEL_TESTS is set to 1, TestHarness.h tries to include itself (which is a no-op):

// In TestHarness.h:
#if WITH_LOW_LEVEL_TESTS
#include "TestHarness.h"   // Including itself here!
#elif ...
...
#endif

I have just excluded the LowLevelTest build from the Configuration Manager. I will rely on it actually passing upstream. It seems to have been fixed in a Github commit

The ChaosUserDataPT.h has been also fixed on the 5.2 branch, GitHub commit - the solution was just to rename SolverSolverBase.

2 Likes