Building my plugin UE5.6 first time and I m getting this error: error C3533: a parameter cannot have a type that contains 'auto'

Hey there,

So just as an example:

`// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;
using System;

public class BuildPipelineHarnessTarget : TargetRules
{
public BuildPipelineHarnessTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
bOverrideBuildEnvironment = true;
CppStandard = CppStandardVersion.Cpp20;
AdditionalCompilerArguments += “/Zc:char8_t-”;

ExtraModuleNames.Add(“BuildPipelineHarness”);
bWarnAboutMonolithicHeadersIncluded = true;
}
}`Will yield an RSP of:

"Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Source/SecondaryModule/SecondaryModule.cpp" @"Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/SecondaryModule.Shared.rsp" /FI"Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/Definitions.h" /Fo"Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/SecondaryModule.cpp.obj" /experimental:log "Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/SecondaryModule.cpp.sarif" /sourceDependencies "Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/SecondaryModule.cpp.dep.json" /d2ssa-cfg-question- /Zc:inline /nologo /Oi /FC /diagnostics:caret /c /Gw /Gy /utf-8 /wd4819 /DSAL_NO_ATTRIBUTE_DECLARATIONS=1 /permissive- /Zc:strictStrings- /Zc:__cplusplus /D_CRT_STDIO_LEGACY_WIDE_SPECIFIERS=1 /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS=1 /D_DISABLE_EXTENDED_ALIGNED_STORAGE /Ob2 /d2ExtendedWarningInfo /Ox /Ot /GF /errorReport:prompt /D_HAS_EXCEPTIONS=0 /DPLATFORM_EXCEPTIONS_DISABLED=1 /Z7 /MD /bigobj /fp:fast /Zo /Zp8 /W4 /wd4244 /wd4838 /TP /GR- /std:c++20 /Zc:preprocessor /wd5054 /Zc:char8_t-Any the following will generate the ordered list:

`// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;
using System;

public class BuildPipelineHarnessTarget : TargetRules
{
public BuildPipelineHarnessTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
bOverrideBuildEnvironment = true;
CppStandard = CppStandardVersion.Cpp20;
AdditionalCompilerArguments += “/std:c++20 /Zc:char8_t-”;

ExtraModuleNames.Add(“BuildPipelineHarness”);
bWarnAboutMonolithicHeadersIncluded = true;
}
}``“Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Source/SecondaryModule/SecondaryModule.cpp”
@“Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/SecondaryModule.Shared.rsp”
/FI"Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/Definitions.h"
/Fo"Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/SecondaryModule.cpp.obj"
/experimental:log “Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/SecondaryModule.cpp.sarif”
/sourceDependencies “Z:/EngineSyncRoot//Sandbox/DevRel/DevTools/Intermediate/Build/Win64/x64/BuildPipelineHarness/Development/SecondaryModule/SecondaryModule.cpp.dep.json”
/d2ssa-cfg-question-
/Zc:inline
/nologo
/Oi
/FC
/diagnostics:caret
/c
/Gw
/Gy
/utf-8
/wd4819
/DSAL_NO_ATTRIBUTE_DECLARATIONS=1
/permissive-
/Zc:strictStrings-
/Zc:__cplusplus
/D_CRT_STDIO_LEGACY_WIDE_SPECIFIERS=1
/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS=1
/D_DISABLE_EXTENDED_ALIGNED_STORAGE
/Ob2
/d2ExtendedWarningInfo
/Ox
/Ot
/GF
/errorReport:prompt
/D_HAS_EXCEPTIONS=0
/DPLATFORM_EXCEPTIONS_DISABLED=1
/Z7
/MD
/bigobj
/fp:fast
/Zo
/Zp8
/W4
/wd4244
/wd4838
/TP
/GR-
/std:c++20
/Zc:preprocessor
/wd5054
/std:c++20 /Zc:char8_t-`This is on a vanilla engine sync of 5.6. Are there any other divergences in UBT on your end (Including the VCToolChain.cs - even in the other ticket the need for adding the Cpp20 is suspect; you should be specifying buildSettings v5 - the engine is c++ 20 compliant)? In your scenario I’d be trying to remove as many Target rules property modifications as I possibly could at the moment.

Edit

Also, I’ve tested this with the Plugin and it appears as though the AdditionalCompileArugments has also cascaded to the *.rsp files of that module as well.

So compile errors not-withstanding, it’s still unclear to me why your Target setup is not propagating the compile arguments to the RSP files.

Julian

Hi Ram,

I ran some extra tests and the compiler is really picky regarding the use of /Zc:char8_t- and it won’t work unless it is specified as the next argument following /std:c++20.

At this point, I would recommend that you keep the divergence in VCToolchain.cs. I will discuss with the UBT owner about the possibility of adding an option at the TargetRules level but this is fairly niche so I’m not sure we will want to maintain such customization.

Martin

Hi Martin.

How do we handle this on vanilla version of the engine, since I dont have access to VCToolChain.cs file?

  1. Also another issue I m facing as mentioned, even introducing the flags in an ordered fashion (/std:c++20 /Zc:char8_t-

) in target.cs, the compiler is not picking up. I m thinking the flag is not working to compile the plugin in my case.

Hi Ram,

I’m afraid I don’t have a good answer regarding the vanilla version of Unreal. I would imagine that all of EA’s project do use the engine sources but I understand this can be problematic to make sure that all users of the plugin will mod the engine sources. I had a discussion with the owner of UBT yesterday and he is fine with adding an option that turn support for char8_t off through the TargetRules in a future release of the engine.

Based on my local experiment, the compiler is really picky regarding the 2 arguments and their placement on the command line. It does work fine when I hack VCToolChain.cs. Using the Additional Arguments fails as I’m assuming that the compiler is ignoring the 2nd instance of /std:c++20. The future TargetRules option will fix this.

Martin