Hello there. I tried searching for an answer online but couldn’t find one. While working along the BattleTank section, my PC power was cut off. Now when I try to recompile in UE, I receive the following error in LogMacro.h, which is set to read-only.
[1/4] TankAimingComponent.cpp
C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(58) : error C2338: Invalid argument(s) passed to FMsg::Logf_Internal
C:\Users\User\Documents\04_BattleTank\BattleTank\Source\BattleTank\Private\TankAimingComponent.cpp(60): note: see reference to function template instantiation ‘void FMsg::Logf_Internal<wchar_t[14],FString>(const ANSICHAR *,int32,const FLogCategoryName &,ELogVerbosity::Type,const FmtType (&),FString)’ being compiled
with
[
FmtType=wchar_t [14]
]
C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(60) : error C4840: non-portable use of class ‘FString’ as an argument to a variadic function
C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(60): note: ‘FString::FString’ is non-trivial
C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\Core\Public\Containers/UnrealString.h(75): note: see declaration of ‘FString::FString’
C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(60): note: the constructor and destructor will not be called; a bitwise copy of the class will be passed as the argument
C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\Core\Public\Windows/WindowsCriticalSection.h(9): note: see declaration of ‘FString’
This is the code both error C2338 and error C4840 send me to:
static void Logf_Internal(const ANSICHAR* File, int32 Line, const FLogCategoryName& Category, ELogVerbosity::Type Verbosity, const FmtType& Fmt, Types... Args)
{
static_assert(TIsArrayOrRefOfType<FmtType, TCHAR>::Value, "Formatting string must be a TCHAR array.");
static_assert(TAnd<TIsValidVariadicFunctionArg<Types>...>::Value, "Invalid argument(s) passed to FMsg::Logf_Internal");
Logf_InternalImpl(File, Line, Category, Verbosity, Fmt, Args...);
}
Thank you.