Error c2440

Doing this assignment for my class a dodgeball game on unreal engine and this error keeps popping up. I have no clue what to do or what it means

Severity Code Description Project File Line Suppression State Details
Error C2440 ‘’: cannot convert from ‘const From *’ to ‘TStringConversion<TStringConvert<From,To>,128>’ Dodgeball C:\Program Files\Epic Games\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h 1048

template <typename To, int32 DefaultConversionSize = DEFAULT_STRING_CONVERSION_SIZE, typename From>
FORCEINLINE auto StringCast(const From* Str)
{
if constexpr (FPlatformString::IsCharEncodingCompatibleWith<From, To>())
{
return TStringPointer((const To*)Str);
}
else
{
return TStringConversion<TStringConvert<From, To>, DefaultConversionSize>(Str);
}
}

1 Like

Hi there!
I think this problem is specifically with UE5, when you have latest Visual Studio updates. I am facing the same issue after updating Visual Studio 2022 to v17.9 yesterday.

Similar issues are reported recently in their community posts:
[Internal compiler error after upgrading Visual Studio to 17.9.0 - Developer Community]
https://developercommunity.visualstudio.com/t/Internal-compiler-error-after-upgrading/10594256?sort=newest&topics=visual+studio+2019&WT.mc_id=WD-MVP-5003763

1 Like
2 Likes

It works. Thank you.

can confirm files given by ydgros do work

Thank you! Had a 5.0.3 project that I could not compile with VS 2022, can compile now with the replaced header files.

@ydgros interested to hear from you more about what the issue was