Getting Error After Adding 'const TCHAR HW[]'

LogLiveCoding: Error: Unable to start live coding session. Some modules have already been hot reloaded.
LogSlate: Window ‘Message’ being destroyed
Message dialog closed, result: Ok, title: Message, text: Live Coding cannot be enabled while hot-reloaded modules are active. Please close the editor and build from your IDE before restarting.
LogLiveCoding: Error: Unable to start live coding session. Some modules have already been hot reloaded.
LogSlate: Window ‘Message’ being destroyed
Message dialog closed, result: Ok, title: Message, text: Live Coding cannot be enabled while hot-reloaded modules are active. Please close the editor and build from your IDE before restarting.
LogVSAccessor: Warning: Couldn’t access Visual Studio
Candidate modules for hot reload:
BullCowGame
Launching UnrealBuildTool… [C:/Program Files/Epic Games/UE_4.26/Engine/Binaries/DotNET/UnrealBuildTool.exe -ModuleWithSuffix=BullCowGame,7225 BullCowGameEditor Win64 Development -Project=“C:/Users/J0hnC0nn0r/Documents/Unreal Projects/BullCowGame-starter-kit/BullCowGame.uproject” “C:/Users/J0hnC0nn0r/Documents/Unreal Projects/BullCowGame-starter-kit/BullCo
wGame.uproject” -IgnoreJunk]
Warning: Starting HotReload took 0.0s.
CompilerResultsLog: New page: Compilation - Dec 30, 2020, 10:01:47 PM
CompilerResultsLog: Building BullCowGameEditor…
CompilerResultsLog: Using Visual Studio 2019 14.28.29335 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
CompilerResultsLog: [Upgrade]
CompilerResultsLog: [Upgrade] Using backward-compatible build settings. The latest version of UE4 sets the following values by default, which may require code changes:
CompilerResultsLog: [Upgrade] bLegacyPublicIncludePaths = false => Omits subfolders from public include paths to reduce compiler command line length. (Previously: true).
CompilerResultsLog: [Upgrade] ShadowVariableWarningLevel = WarningLevel.Error => Treats shadowed variable warnings as errors. (Previously: WarningLevel.Warning).
CompilerResultsLog: [Upgrade] PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs => Set in build.cs files to enables IWYU-style PCH model. See https://docs.unrealengine.com/en-US/Programming/BuildTools/UnrealBuildTool/IWYU/index.html. (Previously: PCHUsageMode.UseSharedPCHs).
CompilerResultsLog: [Upgrade] Suppress this message by setting ‘DefaultBuildSettings = BuildSettingsVersion.V2;’ in BullCowGameEditor.Target.cs, and explicitly overriding settings that differ from the new defaults.
CompilerResultsLog: [Upgrade]
CompilerResultsLog: Building 4 actions with 24 processes…
CompilerResultsLog: [1/4] BullCowCartridge.cpp
CompilerResultsLog: C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Containers/UnrealString.h(1552) : error C2338: Invalid argument(s) passed to FString::Printf
CompilerResultsLog: C:\Users\J0hnC0nn0r\Documents\Unreal Projects\BullCowGame-starter-kit\Source\BullCowGame\Console/Cartridge.h(24): note: see reference to function template instantiation ‘FString FString::Printf<TCHAR[22],FString>(const FmtType (&),FString)’ being compiled
CompilerResultsLog: with
CompilerResultsLog: [
CompilerResultsLog: FmtType=TCHAR [22]
CompilerResultsLog: ]
CompilerResultsLog: C:\Users\J0hnC0nn0r\Documents\Unreal Projects\BullCowGame-starter-kit\Source\BullCowGame\BullCowCartridge.cpp(87): note: see reference to function template instantiation ‘void UCartridge::PrintLine<22,FString>(const TCHAR (&)[22],FString) const’ being compiled
CompilerResultsLog: C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Containers/UnrealString.h(1554) : error C4840: non-portable use of class ‘FString’ as an argument to a variadic function
CompilerResultsLog: C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Containers/UnrealString.h(1554): note: ‘FString::FString’ is non-trivial
CompilerResultsLog: C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Containers/UnrealString.h(190): note: see declaration of ‘FString::FString’
CompilerResultsLog: C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Containers/UnrealString.h(1554): note: the constructor and destructor will not be called; a bitwise copy of the class will be passed as the argument
CompilerResultsLog: C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Windows/WindowsCriticalSection.h(9): note: see declaration of ‘FString’
LogMainFrame: MainFrame: Module compiling took 1.073 seconds
Warning: HotReload failed, recompile failed

Even after commenting the code that I added that lead to this error I can’t compile my code. Hope someone can help me out here

Btw I did try restarting both VS 2019 and Unreal
Also building it from inside VS 2019 opens a new Unreal Editor and gives


But runs fine in the new editor window that opens up

On line 87 I didn’t de-reference the HiddenWord variable. Coming from C# I’m not used to dealing with pointers so I totally overlooked it. Wanted to give a shout out to DanM on the Discord channel for pointing this out too me

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms