Standalone UE programs no longer compile in 5.7

Prior to my studio’s upgrade to 5.7, I had a standalone UE-based program that compiled just fine. Now I always get the errors shown below.

Posting here for a compiler/linker error seems really lame (and incompetent on my part), but in this case, the error is so insidious, that I’ve all but given up. The error has almost no context and is inside of a generated .cpp file. I’m also pretty sure that it can be reproduced easily just by copying the BlankProgram template and renaming it. Why on earth the BlankProgram template still compiles is beyond me. When I copy and rename it into my own project’s directory tree, it just doesn’t compile. I get the errors shown below.

1>------ Building 8 action(s) started ------

1>[1/8] Compile [x64] Module.BuildSettings.cpp

1>[2/8] Link [x64] PatchAnalyzer-BuildSettings.lib

1> Creating library D:/EVE/catalyst/main/Catalyst/Intermediate/Build/Win64/x64/PatchAnalyzer/Development/BuildSettings/PatchAnalyzer-BuildSettings.lib and object D:/EVE/catalyst/main/Catalyst/Intermediate/Build/Win64/x64/PatchAnalyzer/Development/BuildSettings/PatchAnalyzer-BuildSettings.exp

1>[3/8] Link [x64] PatchAnalyzer-BuildSettings.dll

1>[4/8] Compile [x64] PerModuleInline.gen.cpp

1>D:\EVE\catalyst\main\Engine\Source\Runtime\Core\Public\HAL\FMemory.inl(25,24): error C2039: ‘Open’: is not a member of ‘AutoRTFM’

1> void* Ptr = AutoRTFM::Open([Count, Alignment]

1> ^

1>D:\EVE\catalyst\main\Engine\Source\Runtime\AutoRTFM\Public\AutoRTFMTask.h(11,11): note: see declaration of ‘AutoRTFM’

1>namespace AutoRTFM

1> ^

1>D:\EVE\catalyst\main\Engine\Source\Runtime\Core\Public\HAL\FMemory.inl(25,24): error C3861: ‘Open’: identifier not found

1> void* Ptr = AutoRTFM::Open([Count, Alignment]

1> ^

1>D:\EVE\catalyst\main\Engine\Source\Runtime\Core\Public\HAL\FMemory.inl(46,12): error C2039: ‘OnAbort’: is not a member of ‘AutoRTFM’

1> AutoRTFM::OnAbort([Ptr]

1> ^

1>D:\EVE\catalyst\main\Engine\Source\Runtime\AutoRTFM\Public\AutoRTFMTask.h(11,11): note: see declaration of ‘AutoRTFM’

1>namespace AutoRTFM

1> ^

1>D:\EVE\catalyst\main\Engine\Source\Runtime\Core\Public\HAL\FMemory.inl(46,12): error C3861: ‘OnAbort’: identifier not found

1> AutoRTFM::OnAbort([Ptr]

1> ^

1>D:\EVE\catalyst\main\Engine\Source\Runtime\Core\Public\HAL\FMemory.inl(53,19): error C2039: ‘DidAllocate’: is not a member of ‘AutoRTFM’

1> return AutoRTFM::DidAllocate(Ptr, Count);

Further down, I also get…

D:\EVE\catalyst\main\Engine\Source\Runtime\Core\Public\Algo\StableSort.h(23,33): error C2039: ‘UpperBoundInternal’: is not a member of ‘AlgoImpl’

I’ll try turning on the header include tracing.

[Attachment Removed]

Steps to Reproduce
Copy the BlankProgram template into your own project’s source tree, rename it “MyProgram”, rebuild the solution, then try to compile it.

[Attachment Removed]

Hello!

The BlankProgram template is missing DefaultBuildSettings to be able to be compiled in the 5.7 stream. I will fix this for future release. I recommend setting it to BuildSettingsVersion.Latest to use the current version’s settings.

You should also update the value of IncludeOrderVersion if set on a previous release.

public class MyProgramTarget : TargetRules
{
	public MyProgramTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Program;
		IncludeOrderVersion = EngineIncludeOrderVersion.Latest; //or EngineIncludeOrderVersion.Unreal5_7
		DefaultBuildSettings = BuildSettingsVersion.Latest; //or BuildSettingsVersion.V6

This config allows me to compile the BlankProgram template.

If that doesn’t help, you are likely affected by IncludeOrderVersion. This setting has an effect to the headers and what get included. You might simply be missing some include statements that got taken out of other includes to improve the compilation times.

Other sources of weird compilation errors are using a toolchain or SDK that we have not validated with the engine release. For version 5.7, you should be using the 14.44 toolchain and the 22621 SDK. Both can be installed through the VS Installer. If you don’t have those installed, there should be a notification about missing package at the top of the Solution Explorer. You can also find that information in Engine\Config\Windows\Windows_SDK.json

UBT outputs the information when compiling. It looks like this:

Using Visual Studio 2022 14.44.35224 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.44.35207) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).

Regards,

Martin

[Attachment Removed]

This got me going again. Thanks, Martin!

[Attachment Removed]