Failed to compile shipping game with VS 15.3

It seems like VS 15.3 can’t build a shipping executable for unreal 4.17.1.

The code in question:

Hi Zeblote,

I tried to build a project using the Shipping configuration in Visual Studio 15.3, and it completed successfully for me. Would it be possible to get the build log from Visual Studio?

------ Skipped Build: Project: DotNETUtilities, Configuration: Development Any CPU ------
1>Project not selected to build for this solution configuration
2>------ Skipped Build: Project: ShaderCompileWorker, Configuration: Development_Program x64 ------
2>Project not selected to build for this solution configuration
3>------ Build started: Project: BrickSpace, Configuration: Shipping_Game x64 ------
3>Creating makefile for BrickSpace (project files are newer)
3>Performing 3 actions (16 in parallel)
3>UELinkerFixups.cpp
3>Module.Renderer.7_of_11.cpp
3>c:\unrealengine\engine\source\runtime\renderer\private\postprocess\rendertargetpool.cpp(955): error C4723: potential divide by 0
3>ERROR : UBT error : Failed to produce item: C:\BrickSpace\Binaries\Win64\BrickSpace-Win64-Shipping.exe
3>Total build time: 13,43 seconds (Local executor: 0,00 seconds)
3>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command “C:\UnrealEngine\Engine\Build\BatchFiles\Build.bat BrickSpace Win64 Shipping “C:\BrickSpace\BrickSpace.uproject” -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command.
3>Done building project “BrickSpace.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 2 skipped ==========

Do you maybe have both VS 2017 and 2015 installed? I remember placing this in BuildConfiguration to make it actually compile with 2017, not sure if this is still needed.

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
	<BuildConfiguration>
		<ProcessorCountMultiplier>2</ProcessorCountMultiplier>
		<bAllowXGE>false</bAllowXGE>
	</BuildConfiguration>
	<WindowsPlatform>
		<Compiler>VisualStudio2017</Compiler>
	</WindowsPlatform>
	<VCProjectFileGenerator>
		<Version>VisualStudio2017</Version>
	</VCProjectFileGenerator>
</Configuration>

Any news??

we temporarily work it round with

float ScaleX = DisplayExtent.X / ((float)MemoryStats.TotalColumnSize + 0.01f);

Hi ,
You don’t need the build log to figure it out.

MemoryStats.TotalColumnSize was initialized to 0 by struct SMemoryStats’s constructor and only gets assigned in FRenderTargetPool::SMemoryStats FRenderTargetPool::ComputeView(). However, the assigning code will be if out due to it’s Shipping (#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)), left TotalColumnSize remains 0, hence the build failure.

I’m having the same exact issue (in 4.17.1) - cannot build shipping build. Development is fine.
BTW, I was also able to compile a dedicated server version for Linux in shipping build. But it does fail in Win64 client build.

4.17.2 doesn’t fix this issue.

Yep, 4.17.2 still has the same issue.

Hi Zeblote,

Thank you for the additional information you provided. I was able to reproduce the error by making sure that the Visual Studio 2017 compiler was used instead of the Visual Studio 2015 compiler. It doesn’t look like this particular code has changed for the past few Engine versions, so something in version 15.3 of Visual Studio 2017 changed and it is now catching this during the build process. I have entered UE-50562 to have this investigated further.

This has been fixed and will make it onto 4.18. If you need to fix it locally, change the constructor of SMemoryStats to TotalColumnSize(1).