Cannot compile blank C++ 4.26


Hi,
This is baffling. I can compile my 4.19 project. In fact it is quite a big project.
But I cant even compile blank 4.26 C++ project and the errors are as image above.

Edit:
I have been searching internet for months on this problem - none. It looks I am the only one who is facing this problem?

Epic recommends turning off the error list tab because it’s inaccurate. You have errors but those are not it.

Click the output tab at the bottom to see what the real errors are (press F8 to jump through the errors).

Thanks for the reply. There are so many errors and this is a C++ blank project with raytracing turned off, no content.

------ Build started: Project: MyProject2, Configuration: Development_Editor x64 ------
2>------ Skipped Build: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>Project not selected to build for this solution configuration
1>Building MyProject2Editor…
1>Using Visual Studio 2015 14.0 toolchain (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC) and Windows 10.0.17763.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 8 actions with 12 processes…
1> [1/8] SharedPCH.Engine.ShadowErrors.cpp
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\GenericPlatform/GenericPlatformMath.h(32): error C4554: ‘<<’: check operator precedence for possible error; use parentheses to clarify precedence
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\GenericPlatform/GenericPlatformMath.h(37): error C4554: ‘<<’: check operator precedence for possible error; use parentheses to clarify precedence
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\GenericPlatform/GenericPlatformMath.h(62): error C4554: ‘<<’: check operator precedence for possible error; use parentheses to clarify precedence
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\GenericPlatform/GenericPlatformMath.h(95): error C4554: ‘<<’: check operator precedence for possible error; use parentheses to clarify precedence
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\UObject/NameTypes.h(61): error C2416: attribute ‘deprecated(“NAME_INDEX is replaced by FNameEntryId, which is no longer a contiguous integer. Please use ‘GetTypeHash(MyId)’ instead of ‘MyId’ for hash functions. ToUnstableInt() can be used in other advanced cases. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.”)’ cannot be applied in this context
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\Delegates/DelegateInstancesImpl.h(74): error C2338: You cannot use UFunction delegates with non UObject classes.
1> D:\UE_4.26\Engine\Source\Runtime\Core\Public\Delegates/DelegateInstancesImpl.h(192): note: see reference to class template instantiation ‘TBaseUFunctionDelegateInstance<UserClass,WrappedRetValType(ParamTypes…),UserPolicy,VarTypes…>’ being compiled
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\Delegates/DelegateInstancesImpl.h(509): error C2338: You cannot use UObject method delegates with raw pointers.
1> D:\UE_4.26\Engine\Source\Runtime\Core\Public\Delegates/DelegateInstancesImpl.h(637): note: see reference to class template instantiation ‘TBaseUObjectMethodDelegateInstance<bConst,UserClass,WrappedRetValType(ParamTypes…),UserPolicy,VarTypes…>’ being compiled
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\Async/TaskGraphInterfaces.h(1447): warning C4996: ‘FCompletionList::Prerequisites’: The feature is deprecated Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1> D:\UE_4.26\Engine\Source\Runtime\Core\Public\Async/TaskGraphInterfaces.h(1436): note: see declaration of ‘FCompletionList::Prerequisites’
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\Async/TaskGraphInterfaces.h(1456): warning C4996: ‘FCompletionList::CreatePrerequisiteCompletionHandle’: The feature is deprecated Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1> D:\UE_4.26\Engine\Source\Runtime\Core\Public\Async/TaskGraphInterfaces.h(1469): note: see declaration of ‘FCompletionList::CreatePrerequisiteCompletionHandle’
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\Async/TaskGraphInterfaces.h(1474): warning C4996: ‘FCompletionList::Prerequisites’: The feature is deprecated Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1> D:\UE_4.26\Engine\Source\Runtime\Core\Public\Async/TaskGraphInterfaces.h(1436): note: see declaration of ‘FCompletionList::Prerequisites’
1>d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(317): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1> d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(317): note: see usage of ‘/=’
1>d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(318): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1> d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(318): note: see usage of ‘–’
1>d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(319): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1> d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(319): note: see usage of ‘++’
1>d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(328): error C3250: ‘Result’: declaration is not allowed in ‘constexpr’ function body
1>d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(328): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1>d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(331): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1> d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(331): note: see usage of ‘*=’
1> d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(331): note: see usage of ‘++’
1>d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(332): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1> d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(332): note: see usage of ‘–’
1>d:\ue_4.26\engine\source\runtime\core\public\misc\TVariantMeta.h(334): error C3256: ‘Result’: variable use does not produce a constant expression
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\Misc/StringBuilder.h(354): error C2995: ‘unknown-type operator <<(FWideStringBuilderBase &,T &&)’: function template has already been defined
1> D:\UE_4.26\Engine\Source\Runtime\Core\Public\Misc/StringBuilder.h(345): note: see declaration of ‘operator <<’
1>D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/SoftObjectPath.h(36): error C2440: ‘’: cannot convert from ‘const FString’ to ‘FStringView’
1> D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/SoftObjectPath.h(36): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/SoftObjectPath.h(57): error C2440: ‘’: cannot convert from ‘const FString’ to ‘FStringView’
1> D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/SoftObjectPath.h(57): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/SoftObjectPath.h(116): error C2440: ‘’: cannot convert from ‘const FString’ to ‘FStringView’
1> D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\UObject/SoftObjectPath.h(116): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\IO/IoDispatcher.h(831): error C2416: attribute ‘deprecated(“Use FIoDispatcher::NewBatch() instead Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.”)’ cannot be applied in this context
1>D:\UE_4.26\Engine\Source\Runtime\RHI\Public\RHI.h(1683): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1>D:\UE_4.26\Engine\Source\Runtime\RHI\Public\RHI.h(1685): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1>D:\UE_4.26\Engine\Source\Runtime\RHI\Public\RHI.h(1686): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1>D:\UE_4.26\Engine\Source\Runtime\RHI\Public\RHI.h(1687): error C3249: illegal statement or sub-expression for ‘constexpr’ function
1>D:\UE_4.26\Engine\Source\Runtime\RHI\Public\RHI.h(1681): error C3259: ‘constexpr’ functions can only have one return statement
1>D:\UE_4.26\Engine\Source\Runtime\RHI\Public\RHI.h(2018): error C2327: ‘FRHITransition::State’: is not a type name, static, or enumerator
1>D:\UE_4.26\Engine\Source\Runtime\RHI\Public\RHI.h(2018): error C2065: ‘State’: undeclared identifier
1>D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\AssetRegistry/AssetData.h(99): error C2440: ‘’: cannot convert from ‘TStringBuilderWithBuffer<TCHAR,1035>’ to ‘FStringView’
1> D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\AssetRegistry/AssetData.h(99): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\AssetRegistry/AssetData.h(204): error C2664: ‘TStringView::TStringView(TStringView &&)’: cannot convert argument 1 from ‘TStringBuilderWithBuffer<TCHAR,1035>’ to ‘const TCHAR *’
1> D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\AssetRegistry/AssetData.h(204): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\AssetRegistry/AssetData.h(210): error C2664: ‘TStringView::TStringView(TStringView &&)’: cannot convert argument 1 from ‘TStringBuilderWithBuffer<TCHAR,1035>’ to ‘const TCHAR *’
1> D:\UE_4.26\Engine\Source\Runtime\CoreUObject\Public\AssetRegistry/AssetData.h(210): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\Math/GenericOctree.h(1777): warning C4996: ‘TOctree<ElementType,OctreeSemantics>’: was declared deprecated
1> D:\UE_4.26\Engine\Source\Runtime\Core\Public\Math/GenericOctree.h(1784): note: see reference to class template instantiation ‘TOctree<ElementType,OctreeSemantics>’ being compiled
1>D:\UE_4.26\Engine\Source\Runtime\Core\Public\Math/GenericOctree.h(1781): warning C4996: ‘TOctree<ElementType,OctreeSemantics>’: was declared deprecated
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “D:\UE_4.26\Engine\Build\BatchFiles\Build.bat MyProject2Editor Win64 Development -Project=“D:\Project\MyProject2\MyProject2.uproject” -WaitMutex -FromMsBuild” exited with code 6.
1>Done building project “MyProject2.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========

Your visual studio is likely the incorrect version for 4.26. See the Release Notes from 4.26:

Interesting. I can tell you that a brand new blank 4.26 C++ project should compile without issues. A blank project has nothing introduced by the developer yet which could cause a problem. So I would suggest you completely blow away your Unreal installation (and probably even the Epic launcher) and start from scratch. Install the Epic launcher, install UE 4.26, create a new C++ project and build it. Also I would take this opportunity to upgrade to Visual Studio 2019. In fact you can probably uninstall older versions of Visual Studio if you don’t need them, to avoid problems with the different installs clobbering each other with bad PATH variables/etc that may have built up over time.

Again, all I can really tell you is a blank 4.26 C++ project should build just fine. I see references to Visual Studio 2015 and 2017 in your output. And you mention that you have a UE 4.19 project. My guess is overtime all these different versions of installed tools have accumulated cruft and are now colliding with each other and causing config issues. Hope that helps.

Thanks both of you for the replies. In fact I have all 3 vstudio installed 2015,2017,2019. The errors were produced by both 2017 & 2019 and yes…I did notice the rather strange mention of 2015 tools…

i guess I will just reinstall all vstudio…and install 2019 first to see if it fix the problems. Tq.