#802 从UE5.1升级到UE5.4的几个编译失败问题   module     UE4     vsc     3 months ago (owner) Document
  • $(ProjectRoot)/Source/Project.Target.cs以及ProjectEditor.Target.cs
    • DefaultBuildSettings = BuildSettingsVersion.V4; // 5.1中为V2
  • Plugin.Build.cs里的变化
 if (Target.bBuildEditor)
 {
 	PrivateIncludePaths.Add(System.IO.Path.Combine(GetModuleDirectory("LevelEditor"), "Private"));
 	PrivateDependencyModuleNames.Add("LevelEditor");
 	PrivateDependencyModuleNames.Add("SourceControlWindows");
 	PrivateDependencyModuleNames.Add("ProjectSettingsViewer");
 	PrivateDependencyModuleNames.Add("UnrealEd");
 	PrivateDependencyModuleNames.Add("AssetTools");
 	PrivateDependencyModuleNames.Add("ToolMenus");
        PrivateDependencyModuleNames.Add("Blutility");
 }
注意上面PrivateIncludePaths加入了LevelEditor/Private目录,则包含头文件时应如下:
 #if (ENGINE_MAJOR_VERSION >= 5) && (ENGINE_MINOR_VERSION <= 1)
 #include "LevelEditor/Private/SLevelEditor.h"
 #else
 #include "SLevelEditor.h"
 #endif
同样的还有Classes目录的头文件引用:
 #if (ENGINE_MAJOR_VERSION >= 5) && (ENGINE_MINOR_VERSION <= 1)
 #include "LevelEditor/Private/SLevelEditor.h"
 #include "Blutility/Classes/EditorUtilityWidgetBlueprint.h"
 #else
 #include "EditorUtilityWidgetBlueprint.h"
 #endif
 
  • → + #511 module.build.cs文件常见字段   Package   ...   3 months ago (owner) Document