You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

UE5.3与VS2022编译报错:无法访问FHazardRecord私有成员

问题描述
  • 安装Unreal Engine 5.3与Visual Studio 2022后,从UE编辑器创建Pawn类时,Visual Studio无法编译代码,怀疑是版本兼容问题
  • 新建以C++为默认选项的UE5项目,出现相同编译错误,报错日志如下:
Running C:/Program Files/Epic Games/UE_5.3/Engine/Build/BatchFiles/Build.bat Development Win64 -Project="C:/Users/Windows 11/Documents/Unreal Projects/ExplorationGameTest/ExplorationGameTest.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" Development Win64 -Project="C:/Users/Windows 11/Documents/Unreal Projects/ExplorationGameTest/ExplorationGameTest.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Log file: C:\Users\Windows 11\AppData\Local\UnrealBuildTool\Log.txt
Creating makefile for ExplorationGameTestEditor (no existing makefile)
@progress push 5%
Parsing headers for ExplorationGameTestEditor
  Running Internal UnrealHeaderTool "C:\Users\Windows 11\Documents\Unreal Projects\ExplorationGameTest\ExplorationGameTest.uproject" "C:\Users\Windows 11\Documents\Unreal Projects\ExplorationGameTest\Intermediate\Build\Win64\ExplorationGameTestEditor\Development\ExplorationGameTestEditor.uhtmanifest" -WarningsAsErrors -installed
Total of 0 written
Reflection code generated for ExplorationGameTestEditor in 0.6409217 seconds
@progress pop
Building ExplorationGameTestEditor...
Using Visual Studio 2022 14.39.33522 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519) and Windows 10.0.22000.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Determining max actions to execute in parallel (20 physical cores, 28 logical cores)
  Executing up to 20 processes, one per physical core
  Requested 1.5 GB memory per action, 18.41 GB available: limiting max parallel actions to 12
------ Building 6 action(s) started ------
[1/6] Resource Default.rc2
[2/6] Compile [x64] SharedPCH.Engine.Cpp20.cpp
C:\Program Files\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): error C2248: 'FHazardPointerCollection::FHazardRecord::FHazardRecord'? impossible d'acc?der ? private membre d?clar?(e) dans la classe 'FHazardPointerCollection::FHazardRecord'
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(86): note: voir la d?claration de 'FHazardPointerCollection::FHazardRecord::FHazardRecord'
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(77): note: voir la d?claration de 'FHazardPointerCollection::FHazardRecord'
C:\Program Files\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): note: le contexte d'instanciation du mod?le (le plus ancien) est
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(133): note: voir la r?f?rence ? l'instanciation de la fonction mod?le 'void __builtin_array_init_helper<FHazardPointerCollection::FHazardRecord>(_T *,size_t) noexcept(<expr>)' en cours de compilation
        with
        [
            _T=FHazardPointerCollection::FHazardRecord
        ]
Total time in Parallel executor: 8.79 seconds
Total execution time: 10.89 seconds
疑问与求助
  • 无法理解报错原因,注意到日志中_T=FHazardPointerCollection::FHazardRecord这一行
  • 已查阅UE官方论坛相关帖子,但疑惑最新版UE5与VS2022为何会出现该问题,请求分析并给出解决方案

内容的提问来源于stack exchange,提问作者MoonLightAura

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 22:09:52