Hello,
Forgive me if I am not providing proper information in regards to the issue. I’m brand new to this, so I’m hoping I provide enough information or provided error codes properly.
I am taking this course on Udemy: Unreal Engine 5 C++ Developer: Learn C++ & Make Video Games (https://www.udemy.com/course/unrealcourse/). Everything has been going great, up until the lesson where it shows us how to set up C++, Visual Studio, and VSCode. I’m using Unreal version 5.3. My issue is explained below.
I have installed VS, VSCode, and Net .6 as instructed in the lesson. The section that I’m on, we are tasked with creating a new C++ class. As instructed, I went to the Tools tab > New C++ > and created a new Actor named MovingPlatform. The code was generated and opened in VSCode as shown in the video. We are instructed to now close the Unreal editor. In VSCode, we are tasked with compiling and are told to go to the Terminal Tab > Run Build Task and choose the option that reads ProjectNameEditor Win64 Development Build. In the instructors example, the data compiles and he has no errors.
When I follow these steps, I see the following under the Problems tab :
[{
“resource”: “/C:/Users/kanan/OneDrive/Documents/Unreal Projects/ObstacleAssault/Source/ObstacleAssault/MovingPlatform.h”,
“owner”: “C/C++: IntelliSense”,
“code”: “1696”,
“severity”: 8,
“message”: “cannot open source file “MovingPlatform.generated.h””,
“source”: “C/C++”,
“startLineNumber”: 7,
“startColumn”: 1,
“endLineNumber”: 7,
“endColumn”: 38
},{
“resource”: “/C:/Users/kanan/OneDrive/Documents/Unreal Projects/ObstacleAssault/Source/ObstacleAssault/MovingPlatform.h”,
“owner”: “C/C++: IntelliSense”,
“code”: “1696”,
“severity”: 8,
“message”: “#include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit (C:\Users\kanan\OneDrive\Documents\Unreal Projects\ObstacleAssault\Source\ObstacleAssault\MovingPlatform.cpp).”,
“source”: “C/C++”,
“startLineNumber”: 7,
“startColumn”: 1,
“endLineNumber”: 7,
“endColumn”: 38
},{
“resource”: “/c:/Program Files/Epic Games/UE_5.3/Engine/Source/predefined C++ types (compiler internal)”,
“owner”: “msCompile”,
“code”: “C2248”,
“severity”: 8,
“message”: “‘FHazardPointerCollection::FHazardRecord::FHazardRecord’: cannot access private member declared in class ‘FHazardPointerCollection::FHazardRecord’”,
“source”: “cpp”,
“startLineNumber”: 420,
“startColumn”: 1,
“endLineNumber”: 420,
“endColumn”: 2147483647
}]
When I look at the Terminal Tab, I see the follwing:
- Executing task in folder UE_5.3: Engine\Build\BatchFiles\Build.bat ObstacleAssault Win64 Development ‘C:\Users\kanan\OneDrive\Documents\Unreal Projects\ObstacleAssault\ObstacleAssault.uproject’ -waitmutex
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet “…\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” ObstacleAssault Win64 Development “C:\Users\kanan\OneDrive\Documents\Unreal Projects\ObstacleAssault\ObstacleAssault.uproject” -waitmutex
Log file: C:\Users\kanan\AppData\Local\UnrealBuildTool\Log.txt
Creating makefile for ObstacleAssault (no existing makefile)
Parsing headers for ObstacleAssault
Running Internal UnrealHeaderTool “C:\Users\kanan\OneDrive\Documents\Unreal Projects\ObstacleAssault\ObstacleAssault.uproject” “C:\Users\kanan\OneDrive\Documents\Unreal Projects\ObstacleAssault\Intermediate\Build\Win64\ObstacleAssault\Development\ObstacleAssault.uhtmanifest” -WarningsAsErrors -installed
Total of 4 written
Reflection code generated for ObstacleAssault in 1.0845789 seconds
Building ObstacleAssault…
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.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
[Upgrade]
[Upgrade] Using backward-compatible include order. The latest version of UE has changed the order of includes, which may require code changes. The current setting is:
[Upgrade] IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_0
[Upgrade] Suppress this message by setting ‘IncludeOrderVersion = EngineIncludeOrderVersion.Latest;’ in ObstacleAssault.Target.cs.
[Upgrade] Alternatively you can set this to ‘EngineIncludeOrderVersion.Latest’ to always use the latest include order. This will potentially cause compile errors when integrating new versions of the engine.
[Upgrade]
Determining max actions to execute in parallel (8 physical cores, 16 logical cores)
Executing up to 8 processes, one per physical core
Requested 1.5 GB memory per action, 4.09 GB available: limiting max parallel actions to 2
------ Building 16 action(s) started ------
[1/16] Resource Default.rc2
[2/16] Copy OpenImageDenoise.dll
[3/16] Copy tbbmalloc.pdb
[4/16] Copy d3d12SDKLayers.dll
[5/16] Copy tbb12.dll
[6/16] Copy tbb.pdb
[7/16] Copy tbbmalloc.dll
[8/16] Copy D3D12Core.dll
[9/16] Copy tbb.dll
[10/16] Compile [x64] SharedPCH.Engine.Cpp20.InclOrderUnreal5_0.cpp
C:\Program Files\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): error C2248: ‘FHazardPointerCollection::FHazardRecord::FHazardRecord’: cannot access private member declared in class ‘FHazardPointerCollection::FHazardRecord’
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(86): note: see declaration of ‘FHazardPointerCollection::FHazardRecord::FHazardRecord’
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(77): note: see declaration of ‘FHazardPointerCollection::FHazardRecord’
C:\Program Files\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): note: the template instantiation context (the oldest one first) is
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(133): note: see reference to function template instantiation ‘void __builtin_array_init_helperFHazardPointerCollection::FHazardRecord(_T *,size_t) noexcept()’ being compiled
with
[
_T=FHazardPointerCollection::FHazardRecord
]
Total time in Parallel executor: 18.04 seconds
Total execution time: 28.88 seconds
- The terminal process “C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command Engine\Build\BatchFiles\Build.bat ObstacleAssault Win64 Development ‘C:\Users\kanan\OneDrive\Documents\Unreal Projects\ObstacleAssault\ObstacleAssault.uproject’ -waitmutex” terminated with exit code: 1.
- Terminal will be reused by tasks, press any key to close it.
The error occurs on line 10/16. I noticed in the instructors example, only 9 lines are being compiled. I really don’t know what I did wrong, maybe my version 5.3 is causing me issues?
Thanks for your time.