Error creating C++ Project

I have never seen this error message before could someone help me fix it.

If I rebuild in visual studio it has 3 errors and the project says it already exists even though it wasn’t created and nothing is in the file location.

After rebuilding the project in unreal:

Errors building the C++ code:

Running

[1/11] Resource Default.rc2
[2/11] Compile SharedPCH.Engine.ShadowErrors.cpp
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): error C2440: ‘’: cannot convert from ‘const From *’ to ‘TStringConversion<TStringConvert<From,To>,128>’
with
[
From=TCHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion’: no overloaded function could convert all the argument types
with
[
From=TCHAR,
To=ANSICHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(689): note: could be ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const StringConv::FUnused *)’
with
[
From=TCHAR,
To=ANSICHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const StringConv::FUnused *)’: cannot convert argument 1 from ‘const From *’ to ‘const StringConv::FUnused *’
with
[
From=TCHAR,
To=ANSICHAR
]
and
[
From=TCHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(737): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(FromRangeType &&)’
with
[
From=TCHAR,
To=ANSICHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(698): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const SrcBufferType *,int32)’
with
[
From=TCHAR,
To=ANSICHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(677): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const SrcBufferType *)’
with
[
From=TCHAR,
To=ANSICHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: while trying to match the argument list ‘(const From *)’
with
[
From=TCHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: the template instantiation context (the oldest one first) is
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Misc\SecureHash.h(75): note: see reference to function template instantiation ‘auto StringCast<ANSICHAR,128,TCHAR>(const From *)’ being compiled
with
[
From=TCHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): error C2440: ‘’: cannot convert from ‘const From *’ to ‘TStringConversion<TStringConvert<From,To>,128>’
with
[
From=ANSICHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion’: no overloaded function could convert all the argument types
with
[
From=ANSICHAR,
To=TCHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(689): note: could be ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const StringConv::FUnused *)’
with
[
From=ANSICHAR,
To=TCHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const StringConv::FUnused *)’: cannot convert argument 1 from ‘const From *’ to ‘const StringConv::FUnused *’
with
[
From=ANSICHAR,
To=TCHAR
]
and
[
From=ANSICHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(737): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(FromRangeType &&)’
with
[
From=ANSICHAR,
To=TCHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(698): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const SrcBufferType *,int32)’
with
[
From=ANSICHAR,
To=TCHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(677): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const SrcBufferType *)’
with
[
From=ANSICHAR,
To=TCHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: while trying to match the argument list ‘(const From *)’
with
[
From=ANSICHAR
]
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: the template instantiation context (the oldest one first) is
D:\Unreal\UE_5.1.0\UE_5.0\Engine\Source\Runtime\TypedElementFramework\Public\Elements\Framework\TypedElementData.h(64): note: see reference to function template instantiation ‘auto StringCast<TCHAR,128,ANSICHAR>(const From *)’ being compiled
with
[
From=ANSICHAR
]

Don’t suppose you had any luck with this?

man it would be cool if someone could figure this out.
currently cannot compile at all in VS because of this error

This error occurs due to a type mismatch during conversion between character strings of different types (TCHAR and ANSICHAR) in Unreal Engine.

  • Check if your project is using the correct character set (Unicode or Multi-Byte). In Unreal Engine, TCHAR is typically Unicode (wide characters).
  • In Visual Studio, go to:
  • Project Properties > Configuration Properties > General > Character Set
  • Select Use Unicode Character Set.
  • The error points to the use of StringCast or a similar function. Verify that the arguments being passed are compatible types (TCHAR or ANSICHAR).

This is from GPT4.0