虚幻引擎5.1无法在CppStandard设置为c++20的情况下编译

hgtggwj0  于 2023-08-09  发布在  其他
关注(0)|答案(1)|浏览(139)

在新的“空白”项目设置“CppStandard = CppStandardVersion.Cpp20;“.Build.cs”中的“.Build.cs”会导致编译错误:
0>/opt/unreal-engine/Engine/Source/Runtime/Core/Public/Math/SHMath.h:39:38:错误:不同枚举类型之间的算术('TSHVector<2>::(unnamed enum at Runtime/Core/Public/Math/SHMath.h:37:2)'和'TSHVector<2>::(unnamed enum at Runtime/Core/Public/Math/SHMath.h:38:2)')被弃用[-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:参考文件:在这里请求的模板类'TSHVector '的示例化中<2>内联TSHVector <2>TSHVector<2>::SHBasisFunction(const FVector& Vector)
我尝试在“*.Build.cs”文件和“BuildConfig.xml”中禁用警告错误,但没有成功。如何使用C++20标准构建虚幻引擎5.1?
其他信息:

  • 我在Linux上。
  • 我使用JetBrains Rider。
  • 我不是从源头上建立的。
bgtovc5b

bgtovc5b1#

我在从EPIC下载UE5.1.1时遇到了同样的问题(也尝试了从源代码构建),有什么建议吗?

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]

字符串
而这只是我打包apk文件时的应用程序,包exe不会发出此错误
我想补充一点

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


只有#pragma clang diagnostic ignored "-Wmacro-redefined"工作,因为eprecated-enum-enum-conversion.gen.h发出,而不是我的.h文件,我将上面的代码添加到其中

相关问题