Getting errors in stringconv.h while creating new project

Build started at 12:00…
1>------ Build started: Project: CryptRaider, Configuration: Development_Editor x64 ------
1>Using bundled DotNet SDK
1>Log file: C:\Users\Naveen\AppData\Local\UnrealBuildTool\Log.txt
1>Building CryptRaiderEditor…
1>Using Visual Studio 2022 14.39.33519 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>[Adaptive Build] Excluded from CryptRaider unity file: CryptRaider.cpp, CryptRaiderCharacter.cpp, CryptRaiderGameMode.cpp, CryptRaiderProjectile.cpp, Mover.cpp, TP_PickUpComponent.cpp, TP_WeaponComponent.cpp
1>Determining max actions to execute in parallel (8 physical cores, 16 logical cores)
1> Executing up to 8 processes, one per physical core
1> Requested 1.5 GB free memory per action, 163.07 MB available: limiting max parallel actions to 1
1>Building 18 actions with 1 process…
1>[1/18] Compile SharedPCH.Engine.ShadowErrors.cpp
1>E:\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>’
1> with
1> [
1> From=TCHAR
1> ]
1>E:\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
1> with
1> [
1> From=TCHAR,
1> To=ANSICHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(689): note: could be ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const StringConv::FUnused *)’
1> with
1> [
1> From=TCHAR,
1> To=ANSICHAR
1> ]
1>E:\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 *’
1> with
1> [
1> From=TCHAR,
1> To=ANSICHAR
1> ]
1> and
1> [
1> From=TCHAR
1> ]
1>E:\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
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(737): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(FromRangeType &&)’
1> with
1> [
1> From=TCHAR,
1> To=ANSICHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(698): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const SrcBufferType *,int32)’
1> with
1> [
1> From=TCHAR,
1> To=ANSICHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(677): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const SrcBufferType *)’
1> with
1> [
1> From=TCHAR,
1> To=ANSICHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: while trying to match the argument list ‘(const From *)’
1> with
1> [
1> From=TCHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: the template instantiation context (the oldest one first) is
1>E:\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
1> with
1> [
1> From=TCHAR
1> ]
1>E:\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>’
1> with
1> [
1> From=ANSICHAR
1> ]
1>E:\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
1> with
1> [
1> From=ANSICHAR,
1> To=TCHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(689): note: could be ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const StringConv::FUnused *)’
1> with
1> [
1> From=ANSICHAR,
1> To=TCHAR
1> ]
1>E:\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 *’
1> with
1> [
1> From=ANSICHAR,
1> To=TCHAR
1> ]
1> and
1> [
1> From=ANSICHAR
1> ]
1>E:\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
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(737): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(FromRangeType &&)’
1> with
1> [
1> From=ANSICHAR,
1> To=TCHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(698): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const SrcBufferType *,int32)’
1> with
1> [
1> From=ANSICHAR,
1> To=TCHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(677): note: or ‘TStringConversion<TStringConvert<From,To>,128>::TStringConversion(const SrcBufferType *)’
1> with
1> [
1> From=ANSICHAR,
1> To=TCHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: while trying to match the argument list ‘(const From *)’
1> with
1> [
1> From=ANSICHAR
1> ]
1>E:\UE_5.0\Engine\Source\Runtime\Core\Public\Containers\StringConv.h(1048): note: the template instantiation context (the oldest one first) is
1>E:\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
1> with
1> [
1> From=ANSICHAR
1> ]
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “E:\UE_5.0\Engine\Build\BatchFiles\Build.bat CryptRaiderEditor Win64 Development -Project=“F:\UnrealProjects\CryptRaider\CryptRaider\CryptRaider.uproject” -WaitMutex -FromMsBuild” exited with code 6.
1>Done building project “CryptRaider.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 12:05 and took 05:04.951 minutes ==========

I had this recently and it could be because some library updated, so Visual Studio is trying to rebuild lots of Unreal stuff.

To avoid this, if you right click on your solution in the solution explorer and select configuration manager, you can choose to build just your project, and your project’s module rules.

Hey, I am facing the same issue. tried your solution but it didnt fix it!

1 Like

Please do tell when you find a solution…

I ran into this error after Visual Studio 2022 updated. It seems this occurs when compiling against newer versions of MSVC. You’re supposed to be able to change this via Visual Studio → Tools → Get Tools and Features…, going into the “Individual components” tab and unchecking the installation that is causing problems, but no matter how many times I did that the latest version was still installed on my PC. I ended up going here and manually removing the 14.39 directory:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC

and then I was able to compile. What you want to see is this in the Build output:

Using Visual Studio 2022 14.38.33135 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).

Not this:

Using Visual Studio 2022 14.39.33521 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).

EDIT: You do have to have A version of MSVC installed in the Visual Studio Installer, I have “MSVC v143 - VS 2022 C++ x64/x86 build tools (v14.38-17.8)”, as well as a couple of older versions, but the compiler should pick the most recent installed one automatically.

7 Likes
3 Likes

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