2

In a fresh "Blank" project setting "CppStandard = CppStandardVersion.Cpp20;" in "*.Build.cs" leads to compile errors:

0>/opt/unreal-engine/Engine/Source/Runtime/Core/Public/Math/SHMath.h:39:38: Error : arithmetic between different enumeration types ('TSHVector<2>::(unnamed enum at Runtime/Core/Public/Math/SHMath.h:37:2)' and 'TSHVector<2>::(unnamed enum at Runtime/Core/Public/Math/SHMath.h:38:2)') is deprecated [-Werror,-Wdeprecated-anon-enum-enum-conversion] enum { NumSIMDVectors = (MaxSHBasis + NumComponentsPerSIMDVector - 1) / NumComponentsPerSIMDVector }; ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ 0>/opt/unreal-engine/Engine/Source/Runtime/Core/Public/Math/SHMath.h:460:21: Reference : in instantiation of template class 'TSHVector<2>' requested here inline TSHVector<2> TSHVector<2>::SHBasisFunction(const FVector& Vector)

I tried to disable warnings as errors in the "*.Build.cs" file and in the "BuildConfig.xml" with no success. How to build Unreal Engine 5.1 with c++20 standard?

Additional Information:

  • I am on Linux.
  • I use JetBrains Rider.
  • I did not build from sources.
Koronis Neilos
  • 700
  • 2
  • 6
  • 20

1 Answers1

0

I meet same issue on UE5.1.1 download from EPIC (also tried build from source code) any advice?

PackagingResults: Error: bitwise operation between different enumeration types ('UMocopiBPLibrary::(unnamed enum at C:/WORK/ownBuild/vrpico1/Plugins/MocopiLiveLink/Source/MocopiLiveLink/Public/MocopiBPLibrary.h:20:2)' and 'EClassFlags') is deprecated [-Werror,-Wdeprecated-anon-enum-enum-conversion]
PackagingResults: Error: bitwise operation between different enumeration types ('UMocopiLiveLinkSourceFactory::(unnamed enum at C:/WORK/ownBuild/vrpico1/Plugins/MocopiLiveLink/Source/MocopiLiveLink/Private/MocopiLiveLinkSourceFactory.h:19:2)' and 'EClassFlags') is deprecated [-Werror,-Wdeprecated-anon-enum-enum-conversion]
PackagingResults: Error: bitwise operation between different enumeration types ('UMocopiRemapAsset::(unnamed enum at C:/WORK/ownBuild/vrpico1/Plugins/MocopiLiveLink/Source/MocopiLiveLink/Public/MocopiRemapAsset.h:19:2)' and 'EClassFlags') is deprecated [-Werror,-Wdeprecated-anon-enum-enum-conversion]

and this only apper when I package apk file, package exe won't emit this error

I'm trying to add:

#if PLATFORM_ANDROID
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmacro-redefined"
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"
#endif

only #pragma clang diagnostic ignored "-Wmacro-redefined" worked, because eprecated-enum-enum-conversion emit from .gen.h, rather than my .h file, which I add above code into

KSroido
  • 61
  • 8
  • Do not set the c++ standard via a compiler flag. If your desired feature is not in this list "https://docs.unrealengine.com/5.0/en-US/unreal-engine-build-tool-target-reference/" try to not use it. I was lucky and I could change a library my project depends on to not use not supported features. – Koronis Neilos Aug 03 '23 at 09:30
  • 1
    @KoronisNeilos  thanks for your advice. I have solved my problem by using `CppStandard = CppStandardVersion.Cpp17` – KSroido Aug 04 '23 at 01:20