stereolabs / zed-UE5

ZED plugin and examples for Unreal Engine 5 (Standard Engine)
MIT License
63 stars 15 forks source link

Build error in UnrealEngine 5.3 with BuildSettingsVersion.V4 enabled #39

Closed Wertolet closed 2 months ago

Wertolet commented 3 months ago

Preliminary Checks

Description

If project has BuildSettingsVersion.V4 enabled, it would not build. The actual problem is that this option enables TargetRules.CppStandard = CppStandard.Default, which has been changed from Cpp17 to Cpp20.

Steps to Reproduce

  1. Add DefaultBuildSetting = BuildSettingsVersion.V4 into ZEDSamplesEditor.Target.cs, so it would look like this:

    public class ZEDSamplesEditorTarget : TargetRules
    {
    public ZEDSamplesEditorTarget(TargetInfo Target) : base(Target)
    {
        bUseAdaptiveUnityBuild = false;
        DefaultBuildSettings = BuildSettingsVersion.V4;     
        //CppStandard = CppStandardVersion.Cpp20; //Has the same effect
    
                Type = TargetType.Editor;
        ExtraModuleNames.AddRange( new string[] { "ZEDSamples" } );
    }
    }
  2. Build the project
  3. image

Expected Result

Successfull build

Actual Result

Build failed

ZED Camera model

ZED

Environment

OS: Windows
ZED SDK: 4.1.2
CUDA: 12.1

Anything else?

No response