一开始并不知道有源代码版本, 直到昨天上官网才看到……
官网很贴心地提供了源代码编译教程. 编译虚幻引擎源代码
首先是git clone源代码之前要记得先把EPIC账号连接到自己的Github账号, 否则在Github的EPIC用户下根本看不到Unreal这个responsity.(还有这种操作真是第一次见……) 下载源代码这个过程没什么问题, 主要问题发生在生成项目文件阶段, 在运行GenerateProjectFiles.bat后会提示类似下面的错误:
Setting up Unreal Engine 4 project files… C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets( 1122,5): error MSB3644: The reference assemblies for framework “.NETFramework,Version=v4.6.2” were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [C:\repos\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj]
GenerateProjectFiles ERROR: UnrealBuildTool failed to compile.
Press any key to continue . . .
原以为要升级我的.NETFramework版本到4.6.2, 但是在下载安装包以后系统却提示我已经安装了更高的版本了, 然而明明我只看到v4.6.1的版本=。= 于是换了种思路, 只要将UnrealBuildTool.csproj里的TargetFrameworkVersion改成v4.6.1即可, 这样程序又会提示DotNETUtilities.csproj的问题, 只要再把这个文件里的TargetFrameworkVersion同样改成v4.6.1即可.
接下来就是漫长的编译阶段…… 官网上说的是10-40分钟, 可我明明都编译了差不多两个钟…… 与此同时磁盘占用率巨高, 我在打这篇文章的时候真的是卡得怀疑人生QAQ 而且这时候才发现原来搜狗输入法主要是磁盘IO操作囧 换成微软输入法就好了~