🐕

UE5でC++プロジェクトを作成できるようにする

2024/02/29に公開

題名の通り、以下の公式通りにセットアップしてもエラー文が表示されてプロジェクトが作成できなかったので備忘録として解決方法を記録する。

https://docs.unrealengine.com/5.3/ja/setting-up-visual-studio-development-environment-for-cplusplus-projects-in-unreal-engine/


[環境]

  • Windows11
  • UnrealEngine5.3
  • VisualStudio2022(17.9.2)

[エラー文]

Running C:/Program Files/Epic Games/UE_5.3/Engine/Build/BatchFiles/Build.bat Development Win64 -Project="D:/traning/unreal/MyProject4/MyProject4.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="D:/traning/unreal/MyProject4/MyProject4.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Log file: C:\Users\Suzuk\AppData\Local\UnrealBuildTool\Log.txt
Creating makefile for MyProject4Editor (no existing makefile)
@progress push 5%
Parsing headers for MyProject4Editor
  Running Internal UnrealHeaderTool D:\traning\unreal\MyProject4\MyProject4.uproject D:\traning\unreal\MyProject4\Intermediate\Build\Win64\MyProject4Editor\Development\MyProject4Editor.uhtmanifest -WarningsAsErrors -installed
Total of 8 written
Reflection code generated for MyProject4Editor in 0.7046939 seconds
@progress pop
Building MyProject4Editor...
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.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Determining max actions to execute in parallel (12 physical cores, 20 logical cores)
  Executing up to 12 processes, one per physical core
------ Building 13 action(s) started ------
[1/13] Resource Default.rc2
[2/13] Compile [x64] SharedPCH.UnrealEd.Cpp20.cpp
C:\Program Files\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): error C2248: 'FHazardPointerCollection::FHazardRecord::FHazardRecord': private ?????o?[ (?N???X 'FHazardPointerCollection::FHazardRecord' ?Ő錾???????? ?ɃA?N?Z?X?ł??܂???
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(86): note: 'FHazardPointerCollection::FHazardRecord::FHazardRecord' ?̐錾???F???Ă???????
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(77): note: 'FHazardPointerCollection::FHazardRecord' ?̐錾???F???Ă???????
C:\Program Files\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): note: ?e???v???[?g?C???X?^???X???R???e?L?X?g (?ŏ??ɍł?????) ??
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(133): note: ?R???p?C???Ώۂ̊֐? ?e???v???[?g ?C???X?^???X?? 'void __builtin_array_init_helper<FHazardPointerCollection::FHazardRecord>(_T *,size_t) noexcept(<expr>)' ?̃??t?@?????X???F???Ă???????
        with
        [
            _T=FHazardPointerCollection::FHazardRecord
        ]
Total time in Parallel executor: 11.86 seconds
Total execution time: 14.79 seconds

[解決方法]

  • [MSVC v143 - VS 2022 C++ x64/86 ビルド ツール (v14.34-17.4)]
    をインストールしたらプロジェクトの作成が行えた。

[解決方法(詳細)]
1:VisualStudio Installerを開いて画像の強調部分をクリック

2:印をつけたコンポーネントをインストール


[感想]
結局何が原因なのか分からなかった。

Discussion