【UE4源代码观察】手动建立一个使用UBT进行编译的空白工程

2024-09-06 23:58

本文主要是介绍【UE4源代码观察】手动建立一个使用UBT进行编译的空白工程,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

我想观察UE4是怎么编译的,于是查阅官方文档,了解到UE4有一套自己的编译工具:UnrealBuildTool,简称UBT。关于UBT的官方文档参阅:虚幻编译工具。我想尝试自己手动建立一个使用UBT进行编译的空白工程。不过首先,先了解下UBT的编译流程中一些文件所扮演的角色

UBT的编译流程中一些文件所扮演的角色

模块

每个模块都由一个 .build.cs 文件声明,它存储在 Source 目录下。属于一个模块的C++源代码与.build.cs文件并列存储,或者存储在它的子目录中。每个.build.cs文件都声明一个类,继承ModuleRules。模块的详细概念与配置属性参见官方文档。

目标

每个目标都由一个.target.cs 文件声明,存储在 Source 目录下。每个.target.cs文件都声明一个类,继承TargetRules。目标的详细概念与配置属性参见官方文档。
值得提及的是,目标会指明一个启动模块(LaunchModuleName),即程序从哪个模块启动。它的定义如下:

        /// <summary>/// Specifies the name of the launch module. For modular builds, this is the module that is compiled into the target's executable./// </summary>public string LaunchModuleName{get{return (LaunchModuleNamePrivate == null && Type != global::UnrealBuildTool.TargetType.Program)? "Launch" : LaunchModuleNamePrivate;}set{LaunchModuleNamePrivate = value;}}

它的逻辑是:如果没有手动指定一个启动模块,而且这个目标类型不是Program,则默认从"Launch"这个模块启动。

VS中的工程文件

官方文档指出:It is important to understand that the build process executes independently of any project files for the development environment, such as .sln or .vcproj files (for Visual Studio)(有一个重要的要明白的事情是:编译的过程与开发环境中的项目文件(如VS中的.sln和.vcproj)是无关的)。即没有VS中的工程文件UE4也能编译,工程文件只是有助于在VS里编辑。
打开UE4源代码中的BlankProgram工程的属性查看:
在这里插入图片描述
发现“生成”“重新生成”“清除”命令实际上是调用了批处理脚本,并在参数中传给它一个 目标。
然后打开Build.bat:

@echo off
setlocal enabledelayedexpansionREM The %~dp0 specifier resolves to the path to the directory where this .bat is located in.
REM We use this so that regardless of where the .bat file was executed from, we can change to
REM directory relative to where we know the .bat is stored.
pushd "%~dp0\..\..\Source"REM %1 is the game name
REM %2 is the platform name
REM %3 is the configuration nameIF EXIST ..\..\Engine\Binaries\DotNET\UnrealBuildTool.exe (..\..\Engine\Binaries\DotNET\UnrealBuildTool.exe %*popdREM Ignore exit codes of 2 ("ECompilationResult.UpToDate") from UBT; it's not a failure.if "!ERRORLEVEL!"=="2" (EXIT /B 0)EXIT /B !ERRORLEVEL!
) ELSE (ECHO UnrealBuildTool.exe not found in ..\..\Engine\Binaries\DotNET\UnrealBuildTool.exe popdEXIT /B 999
)

发现它实际打开了UnrealBuildTool.exe 并将参数传给它。

开始动手实践!

思路是先编译出UnrealBuildTool.exe,然后配置一个目标并配一个空的启动模块,最后用UBT编译这个目标。整个过程中遇到了很多问题,我都将其记录了下来。完整的代码可见:完整代码GIT

0.建立一个空解决方案

在这里插入图片描述

1.建立UnrealBuildTool项目并编译
1.1

将源代码引擎目录里的 \Engine\Source\Programs\UnrealBuildTool 这个项目拷贝到自己的解决方案目录里。注意保持目录层级一样。

1.2

将 UnrealBuildTool.csproj 添加到自己的解决方案中,发现添加后立即有报错
[失败] 未能找到文件“D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\DotNETCommon\MetaData.cs”。
我打开UE4源代码的解决方案的属性发现:UnrealBuildTool 是依赖于 DotNETCommon的
在这里插入图片描述
那么将DotNETCommon这个项目也拷贝过来并添加吧。

1.3

启动生成:

1>------ 已启动生成: 项目: DotNETUtilities, 配置: Debug Any CPU ------
1>  DotNETUtilities -> D:\0_WorkSpace\UEYaksueTest\Engine\Binaries\DotNET\DotNETUtilities.dll
2>------ 已启动生成: 项目: UnrealBuildTool, 配置: Debug Any CPU ------
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: 未能解析此引用。未能找到程序集“Ionic.Zip.Reduced”。请检查磁盘上是否存在该程序集。 如果您的代码需要此引用,则可能出现编译错误。
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: 未能解析此引用。未能找到程序集“Microsoft.VisualStudio.Setup.Configuration.Interop”。请检查磁盘上是否存在该程序集。 如果您的代码需要此引用,则可能出现编译错误。
2>D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Platform\Mac\MacToolChain.cs(11,7,11,12): error CS0246: 未能找到类型或命名空间名“Ionic”(是否缺少 using 指令或程序集引用?)
2>D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Platform\Mac\UEDeployMac.cs(10,7,10,12): error CS0246: 未能找到类型或命名空间名“Ionic”(是否缺少 using 指令或程序集引用?)
2>D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Platform\TVOS\TVOSToolChain.cs(13,7,13,12): error CS0246: 未能找到类型或命名空间名“Ionic”(是否缺少 using 指令或程序集引用?)
2>D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Platform\TVOS\TVOSToolChain.cs(14,7,14,12): error CS0246: 未能找到类型或命名空间名“Ionic”(是否缺少 using 指令或程序集引用?)
2>D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Platform\Android\AndroidAARHandler.cs(13,7,13,12): error CS0246: 未能找到类型或命名空间名“Ionic”(是否缺少 using 指令或程序集引用?)
2>D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Platform\IOS\IOSToolChain.cs(14,7,14,12): error CS0246: 未能找到类型或命名空间名“Ionic”(是否缺少 using 指令或程序集引用?)
2>D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Platform\IOS\IOSToolChain.cs(15,7,15,12): error CS0246: 未能找到类型或命名空间名“Ionic”(是否缺少 using 指令或程序集引用?)
2>D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Platform\Windows\UEBuildWindows.cs(11,17,11,29): error CS0234: 命名空间“Microsoft”中不存在类型或命名空间名“VisualStudio”(是否缺少程序集引用?)
========== 生成: 成功 1 个,失败 1 个,最新 0 个,跳过 0 个 ==========

发现DotNet生成成功了,但是UBT还是失败了,看log应该是没有找到 程序集“Ionic.Zip.Reduced” 和 程序集“Microsoft.VisualStudio.Setup.Configuration.Interop”。

1.4

“Microsoft.VisualStudio.Setup.Configuration.Interop”这个dll我在源代码目录的\Engine\Binaries\ThirdParty\VisualStudio 文件夹找到了,于是就把这个文件夹拷贝过来,奏效了!
“Ionic.Zip.Reduced”也在ThirdParty中能找到,可惜我按照同样的方法拷贝过来后并不奏效

1.5

我在源代码目录里搜索Ionic.Zip.Reduced发现有四个位置存在
在这里插入图片描述
我对程序如何寻找dll的机制并不了解,但是\Engine\Binaries\DotNET 是 UnrealBuildTool的输出目录,exe会被放在这里,所以我试着将dll放在这个目录里,结果奏效了。

1.6

启动生成,成功了

1>------ 已启动生成: 项目: UnrealBuildTool, 配置: Debug Any CPU ------
1>  UnrealBuildTool -> D:\0_WorkSpace\UEYaksueTest\Engine\Binaries\DotNET\UnrealBuildTool.exe
========== 生成: 成功 1 个,失败 0 个,最新 1 个,跳过 0 个 ==========
2.配置模块,目标,项目

配置过程中参考了BlankProgram。但对比它,我想要一个更空白的工程。BlankProgram依赖 Core Projects模块,而我不想依赖它们。

2.1配置模块

2.1.1 模块文件夹位置
首先确定的是模块一定要位于Source目录下,但是否还需要放在Source中的 Runtime或Editor等子文件夹下,我并不确定。但我观察到源代码中的模块都在子文件夹下,而且UnrealBuildTool的C#代码中有关于此的硬编码:

        /// <summary>/// Full path to the Engine/Source/Runtime directory/// </summary>public static readonly DirectoryReference EngineSourceRuntimeDirectory = DirectoryReference.Combine(EngineSourceDirectory, "Runtime");/// <summary>/// Full path to the Engine/Source/Developer directory/// </summary>public static readonly DirectoryReference EngineSourceDeveloperDirectory = DirectoryReference.Combine(EngineSourceDirectory, "Developer");/// <summary>/// Full path to the Engine/Source/Editor directory/// </summary>public static readonly DirectoryReference EngineSourceEditorDirectory = DirectoryReference.Combine(EngineSourceDirectory, "Editor");/// <summary>/// Full path to the Engine/Source/Programs directory/// </summary>public static readonly DirectoryReference EngineSourceProgramsDirectory = DirectoryReference.Combine(EngineSourceDirectory, "Programs");/// <summary>/// Full path to the Engine/Source/ThirdParty directory/// </summary>public static readonly DirectoryReference EngineSourceThirdPartyDirectory = DirectoryReference.Combine(EngineSourceDirectory, "ThirdParty");

所以我决定将模块放在一个子文件夹下。
我觉得我要添加的模块属于“独立的程序”,所以应该放在Programs文件夹下(BlankProgram所创建的模块也是Programs下的)。我将模块起名为TestA,最终目录层级为:\Engine\Source\Programs\TestA

2.1.2 在刚创建的文件夹中创建TestA.Build.cs文件
它基本上没有内容,只是继承了ModuleRules

using UnrealBuildTool;
public class TestA : ModuleRules
{public TestA(ReadOnlyTargetRules Target) : base(Target){	}
}

2.1.3在刚创建的文件夹中创建TestA.cpp文件
它就是个空白的只包含一个main函数的文件

int main()
{return 0;
}
2.2配置目标

将源代码中的 BlankProgram.Target.cs 文件拷贝过来到我们的Source目录中,改名为Test1.Target.cs。Test1是我们的目标的名字。打开文件将类的名字改为Test1,并将LaunchModuleName 改为 TestA,其他原封不动。

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.using UnrealBuildTool;
using System.Collections.Generic;[SupportedPlatforms(UnrealPlatformClass.Desktop)]
public class Test1Target : TargetRules
{public Test1Target(TargetInfo Target) : base(Target){Type = TargetType.Program;LinkType = TargetLinkType.Monolithic;LaunchModuleName = "TestA";// Lean and meanbBuildDeveloperTools = false;// Never use malloc profiling in Unreal Header Tool.  We set this because often UHT is compiled right before the engine// automatically by Unreal Build Tool, but if bUseMallocProfiler is defined, UHT can operate incorrectly.bUseMallocProfiler = false;// Editor-only data, however, is neededbBuildWithEditorOnlyData = true;// Currently this app is not linking against the engine, so we'll compile out references from Core to the rest of the enginebCompileAgainstEngine = false;bCompileAgainstCoreUObject = false;bCompileAgainstApplicationCore = false;// UnrealHeaderTool is a console application, not a Windows app (sets entry point to main(), instead of WinMain())bIsBuildingConsoleApplication = true;}
}
2.3配置项目

2.3.1工程文件位置
UE4源代码目录里有一个 GenerateProject.bat 批处理文件来自动生成工程文件,.vcxproj文件会被放到\Engine\Intermediate\ProjectFiles 文件夹中。我决定也将.vcxproj文件放到这里以保持相同层级,这样会减少后续路径配置的改动。

2.3.2创建新的空白项目
在这里插入图片描述
然而这样的.vcxproj文件层级目录和预期有差别。直接生成的是这样的:
\Engine\Intermediate\ProjectFiles\Test1\Test1.vcxproj
而预期是这样的:
\Engine\Intermediate\ProjectFiles\Test1.vcxproj
因此只能将Test1.vcxproj以及同目录的配套文件都放入上一层级,之后解决方案中还需要再添加一次这个项目。

2.3.3 配置项目使用UBT进行编译
首先先将配置类型改为“生成文件”
在这里插入图片描述
点击应用后,会出现NMake的分栏,仿照BlankProgram对其进行配置,不过需要将BlankProgram改为Test1,因为Test1才是目标
在这里插入图片描述

2.3.4将用到的三个脚本:Build.bat Rebuild.bat Clean.bat 都从源代码目录拷贝过来。他们在\Engine\Build\BatchFiles目录中,注意保持层级目录相同。

3.确保编译成功

先将平台设置为x64,(因为我们刚才配置的平台是x64)
在这里插入图片描述
然后对Test1项目进行build,会出现一系列问题,下面逐步解决:

3.1

UnrealBuildTool : error : Unhandled exception: System.TypeInitializationException: “UnrealBuildTool.InstalledPlatformInfo”的类型初始值设定项引发异常。 ---> System.IO.DirectoryNotFoundException: 未能找到路径“D:\0_WorkSpace\UEYaksueTest\Engine\Config”的一部分。
看来是需要Config文件,我直接将Config文件夹全部拷贝过来

3.2

UnrealBuildTool : error : Version file is missing (D:\0_WorkSpace\UEYaksueTest\Engine\Build\Build.version)
看来需要Build.version文件,拷贝过来。

3.3

接下来遇到了这个报错:

1>------ 已启动生成: 项目: Test1, 配置: Debug x64 ------
1>Creating makefile for Test1 (no existing makefile)
1>UnrealBuildTool : error : Unhandled exception: Tools.DotNETCommon.JsonParseException: Unable to parse D:\0_WorkSpace\UEYaksueTest\Engine\Intermediate\Build\BuildRules\UE4ProgramRulesManifest.json: 索引超出了数组界限。
1>                           在 Tools.DotNETCommon.JsonObject.Read(FileReference File) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\DotNETCommon\DotNETUtilities\JsonObject.cs:行号 57
1>                           在 UnrealBuildTool.DynamicCompilation.RequiresCompilation(HashSet`1 SourceFiles, FileReference AssemblyManifestFilePath, FileReference OutputAssemblyPath) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:行号 67
1>                           在 UnrealBuildTool.DynamicCompilation.CompileAndLoadAssembly(FileReference OutputAssemblyPath, HashSet`1 SourceFileNames, List`1 ReferencedAssembies, List`1 PreprocessorDefines, Boolean DoNotCompile, Boolean TreatWarningsAsErrors) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\System\DynamicCompilation.cs:行号 405
1>                           在 UnrealBuildTool.RulesAssembly..ctor(RulesScope Scope, DirectoryReference BaseDir, IReadOnlyList`1 Plugins, Dictionary`2 ModuleFileToContext, List`1 TargetFiles, FileReference AssemblyFileName, Boolean bContainsEngineModules, Nullable`1 DefaultBuildSettings, Boolean bReadOnly, Boolean bSkipCompile, RulesAssembly Parent) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:行号 115
1>                           在 UnrealBuildTool.RulesCompiler.CreateEngineOrEnterpriseRulesAssembly(RulesScope Scope, List`1 RootDirectories, String AssemblyPrefix, IReadOnlyList`1 Plugins, Boolean bReadOnly, Boolean bSkipCompile, RulesAssembly Parent) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\System\RulesCompiler.cs:行号 501
1>                           在 UnrealBuildTool.RulesCompiler.CreateEngineRulesAssembly(Boolean bUsePrecompiled, Boolean bSkipCompile) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\System\RulesCompiler.cs:行号 394
1>                           在 UnrealBuildTool.RulesCompiler.CreateTargetRulesAssembly(FileReference ProjectFile, String TargetName, Boolean bSkipRulesCompile, Boolean bUsePrecompiled, FileReference ForeignPlugin) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\System\RulesCompiler.cs:行号 658
1>                           在 UnrealBuildTool.UEBuildTarget.Create(TargetDescriptor Descriptor, Boolean bSkipRulesCompile, Boolean bUsePrecompiled) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:行号 606
1>                           在 UnrealBuildTool.BuildMode.CreateMakefile(BuildConfiguration BuildConfiguration, TargetDescriptor TargetDescriptor, ISourceFileWorkingSet WorkingSet) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:行号 433
1>                           在 UnrealBuildTool.BuildMode.Build(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:行号 220
1>                           在 UnrealBuildTool.BuildMode.Execute(CommandLineArguments Arguments) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:行号 192
1>                           在 UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:行号 520
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: 命令“..\..\Build\BatchFiles\Build.bat Test1 Win64 Development -WaitMutex -FromMsBuild”已退出,代码为 5。请验证您是否拥有运行此命令的足够权限。
1>已完成生成项目“Test1.vcxproj”的操作 - 失败。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

我并不能理解这个报错,但是我观察到\Engine\Intermediate\Build这个文件夹是在build中生成的,我想这是中间文件,我想之前的错误可能会引起生成错误的中间文件。于是我删除了这个文件夹,并再次点击生成。

1>------ 已启动生成: 项目: Test1, 配置: Debug x64 ------
1>Creating makefile for Test1 (no existing makefile)
1>While compiling D:\0_WorkSpace\UEYaksueTest\Engine\Intermediate\Build\BuildRules\UE4ProgramRules.dll:
1>EXEC : warning CS1668: “LIB 环境变量”中指定的搜索路径“C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\atlmfc\lib\x64”无效 --“系统找不到指定的路径。 ”
1>UnrealBuildTool : error : Unable to find ISPC compiler path under D:\0_WorkSpace\UEYaksueTest\Engine\Source\ThirdParty\IntelISPC\bin\Windows\ispc.exe
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: 命令“..\..\Build\BatchFiles\Build.bat Test1 Win64 Development -WaitMutex -FromMsBuild”已退出,代码为 5。请验证您是否拥有运行此命令的足够权限。
1>已完成生成项目“Test1.vcxproj”的操作 - 失败。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

幸运的是,这次的提示比较明确:没有找到 ISPC编译器。于是拷贝这个exe。

3.4

接下来build出现的error:
EXEC : fatal error RC1110: could not open D:\0_WorkSpace\UEYaksueTest\Engine\Build\Windows\Resources\Default.rc2
看来 \Engine\Build\Windows\ 是需要的,于是拷贝这个文件夹。

3.5

接下来的error:
D:\0_WorkSpace\UEYaksueTest\Engine\Build\Windows\Resources\Default.rc2(5): fatal error RC1015: cannot open include file '../../../Source/Runtime/Launch/Resources/Windows/resource.h'.
看来Default.rc2这个文件include的一些文件并没有找到:

#include "../../../Source/Runtime/Launch/Resources/Windows/resource.h"
#include "../../../Source/Runtime/Core/Public/Misc/CoreMiscDefines.h"
#include "../../../Source/Runtime/Launch/Resources/Version.h"

这些文件是Core模块和Launch模块中的。所幸这些文件本身并没有再include更多的头文件,最后我将涉及到的头文件都拷贝了过来,它们是:
\Engine\Source\Runtime\Core\Public\HAL\PreprocessorHelpers.h
\Engine\Source\Runtime\Core\Public\Misc\CoreMiscDefines.h
\Engine\Source\Runtime\Launch\Resources\Windows\resource.h
\Engine\Source\Runtime\Launch\Resources\Version.h

3.6

终于,build成功!

1>------ 已启动生成: 项目: Test1, 配置: Debug x64 ------
1>Building Test1...
1>Using Visual Studio 2017 14.16.27035 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023) and Windows 10.0.17763.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 3 actions with 8 processes...
1>  [1/3] Default.rc2
1>  [2/3] Test1.exe
1>  [3/3] Test1.target
1>Total time in Parallel executor: 0.58 seconds
1>Total execution time: 0.77 seconds
========== 生成: 成功 1 个,失败 0 个,最新 0 个,跳过 0 个 ==========

在这里插入图片描述

其他问题

1

'"D:\0_WorkSpace\UEYaksueTest\Engine\Build\BatchFiles\GetMSBuildPath.bat"' 不是内部或外部命令,也不是可运行的程序
拷贝GetMSBuildPath.bat可解决

2 启动清理命令时失败
1>------ 已启动清理: 项目: Test1, 配置: Debug x64 ------
1>Cleaning Test1 and UnrealHeaderTool binaries...
1>UnrealBuildTool : error : Unhandled exception: System.NullReferenceException: 未将对象引用设置到对象的实例。
1>                           在 UnrealBuildTool.RulesAssembly.CreateTargetRules(String TargetName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, String Architecture, FileReference ProjectFile, CommandLineArguments Arguments) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:行号 599
1>                           在 UnrealBuildTool.RulesAssembly.CreateTargetRules(String TargetName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, String Architecture, FileReference ProjectFile, CommandLineArguments Arguments) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:行号 614
1>                           在 UnrealBuildTool.CleanMode.Execute(CommandLineArguments Arguments) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\Modes\CleanMode.cs:行号 94
1>                           在 UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) 位置 D:\0_WorkSpace\UEYaksueTest\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:行号 517
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(39,5): error MSB3073: 命令“..\..\Build\BatchFiles\Clean.bat Test1 Win64 Development -WaitMutex -FromMsBuild”已退出,代码为 -1。
1>已完成生成项目“Test1.vcxproj”的操作 - 失败。
========== 清理: 成功 0 个,失败 1 个,跳过 0 个 ==========

目前还没有解决这一问题,可能和UnrealHeaderTool 有关,待后续观察。

这篇关于【UE4源代码观察】手动建立一个使用UBT进行编译的空白工程的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1143484

相关文章

Spring IoC 容器的使用详解(最新整理)

《SpringIoC容器的使用详解(最新整理)》文章介绍了Spring框架中的应用分层思想与IoC容器原理,通过分层解耦业务逻辑、数据访问等模块,IoC容器利用@Component注解管理Bean... 目录1. 应用分层2. IoC 的介绍3. IoC 容器的使用3.1. bean 的存储3.2. 方法注

Python内置函数之classmethod函数使用详解

《Python内置函数之classmethod函数使用详解》:本文主要介绍Python内置函数之classmethod函数使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录1. 类方法定义与基本语法2. 类方法 vs 实例方法 vs 静态方法3. 核心特性与用法(1编程客

Linux中压缩、网络传输与系统监控工具的使用完整指南

《Linux中压缩、网络传输与系统监控工具的使用完整指南》在Linux系统管理中,压缩与传输工具是数据备份和远程协作的桥梁,而系统监控工具则是保障服务器稳定运行的眼睛,下面小编就来和大家详细介绍一下它... 目录引言一、压缩与解压:数据存储与传输的优化核心1. zip/unzip:通用压缩格式的便捷操作2.

使用Python实现可恢复式多线程下载器

《使用Python实现可恢复式多线程下载器》在数字时代,大文件下载已成为日常操作,本文将手把手教你用Python打造专业级下载器,实现断点续传,多线程加速,速度限制等功能,感兴趣的小伙伴可以了解下... 目录一、智能续传:从崩溃边缘抢救进度二、多线程加速:榨干网络带宽三、速度控制:做网络的好邻居四、终端交互

Python中注释使用方法举例详解

《Python中注释使用方法举例详解》在Python编程语言中注释是必不可少的一部分,它有助于提高代码的可读性和维护性,:本文主要介绍Python中注释使用方法的相关资料,需要的朋友可以参考下... 目录一、前言二、什么是注释?示例:三、单行注释语法:以 China编程# 开头,后面的内容为注释内容示例:示例:四

Visual Studio 2022 编译C++20代码的图文步骤

《VisualStudio2022编译C++20代码的图文步骤》在VisualStudio中启用C++20import功能,需设置语言标准为ISOC++20,开启扫描源查找模块依赖及实验性标... 默认创建Visual Studio桌面控制台项目代码包含C++20的import方法。右键项目的属性:

Go语言数据库编程GORM 的基本使用详解

《Go语言数据库编程GORM的基本使用详解》GORM是Go语言流行的ORM框架,封装database/sql,支持自动迁移、关联、事务等,提供CRUD、条件查询、钩子函数、日志等功能,简化数据库操作... 目录一、安装与初始化1. 安装 GORM 及数据库驱动2. 建立数据库连接二、定义模型结构体三、自动迁

ModelMapper基本使用和常见场景示例详解

《ModelMapper基本使用和常见场景示例详解》ModelMapper是Java对象映射库,支持自动映射、自定义规则、集合转换及高级配置(如匹配策略、转换器),可集成SpringBoot,减少样板... 目录1. 添加依赖2. 基本用法示例:简单对象映射3. 自定义映射规则4. 集合映射5. 高级配置匹

Spring 框架之Springfox使用详解

《Spring框架之Springfox使用详解》Springfox是Spring框架的API文档工具,集成Swagger规范,自动生成文档并支持多语言/版本,模块化设计便于扩展,但存在版本兼容性、性... 目录核心功能工作原理模块化设计使用示例注意事项优缺点优点缺点总结适用场景建议总结Springfox 是

嵌入式数据库SQLite 3配置使用讲解

《嵌入式数据库SQLite3配置使用讲解》本文强调嵌入式项目中SQLite3数据库的重要性,因其零配置、轻量级、跨平台及事务处理特性,可保障数据溯源与责任明确,详细讲解安装配置、基础语法及SQLit... 目录0、惨痛教训1、SQLite3环境配置(1)、下载安装SQLite库(2)、解压下载的文件(3)、