当你使用的是源码编译的虚幻unreal编辑器
https://github.com/orgs/EpicGames/teams/developers
搜索到你想要的版本对应的分支,并进入切换
或者从这里下载稳定发布版。
(注意下载4.27.2压缩包可能才380+M,解压后要113G+,所以最好预留空间120G)
在这里键入cmd
H:\UnrealEngine-4.27.2-release>Setup.bat
Checking dependencies...
Updating dependencies: 0% (0/64293)...
Failed to download 'http://cdn.unrealengine.com/dependencies/UnrealEngine-14805547-80839359d1e04eb28d3d7b794a3a9dc8/02da8f7e7b5b3d20a5b372475e66a273266f0577': 远程服务器返回错误: (403) 已禁止。 (WebException)
请按任意键继续. . .
下载下方的文件Commit.gitdeps.xml,替换本地的Engine/Build/Commit.gitdeps.xml
H:\UnrealEngine-4.27.2-release>Setup.bat
Checking dependencies...
Updating dependencies: 100% (64292/64292), 12055.5/12055.5 MiB | 0.25 MiB/s, done.
Installing prerequisites...
执行GenerateProjectFiles.bat
H:\UnrealEngine-4.27.2-release>GenerateProjectFiles.bat
Setting up Unreal Engine 4 project files...
Binding IntelliSense data... 100%
Writing project files... 100%
打开生成好的sln工程文件,
设置编译的模式,选择DebugGame Editor
如果你忘了选这个,生产的很可能是UE4Game,启动会提示“初始化全局着色器库所需的游戏文件缺失”。
右键对UE4/5设置为启动项,再重新生成(注意不是生成,点击生成可能导致其他项目并没真正有生产。)
error C4834: 放弃具有 [[nodiscard]] 属性的函数的返回值
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, (TEXT("Unable to find Action [%s] for Action Set [%s]"), *ActionName.ToString(), *ActionSet.ToString()));
改为
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Unable to find Action [%s] for Action Set [%s]"), *ActionName.ToString(), *ActionSet.ToString()));
C1060 编译器的堆空间不足
右键我的电脑-》属性-》高级系统设置-》
(不知道是不是我的错觉,联想Y700+16G内存条用vs22才用了20分钟,以往用vs19都要1~2小时。)
error C4668: 没有将“_NOEXCEPT_TYPES_SUPPORTED”定义为预处理器宏,用“0”替换“#if/#elif”
找到HoloLensTargetPlatform.Build.cs文件,打开,在最后一行添加代码
bEnableUndefinedIdentifierWarnings = false,解决报错。
参考,:https://blog.csdn.net/qq_59095655/article/details/132892549
error C4756: 常量算法中溢出
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration"><WindowsPlatform><WindowsSdkVersion >10.0.20348.0</WindowsSdkVersion>
</WindowsPlatform>
</Configuration>
编译器的堆空间不足
解决方案:
尝试将虚拟内存调整为16G。
Module.Persona.4_of_5.cpp
1>cl : 命令行 error D8000: 未知的命令行错误
1> 请选择 Visual C++“帮助”菜单上的“技术支持”命令,
1> 或打开技术支持帮助文件来获得详细信息
解决方案:
添加MSVC的版本CompilerVersion 。
可以通过如下路径查看到本机MSVC的版本。
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration"><WindowsPlatform><CompilerVersion >14.43.34808</CompilerVersion><WindowsSdkVersion >10.0.20348.0</WindowsSdkVersion>
</WindowsPlatform>
</Configuration>