虚幻:诊断Windows无法加载DLL的原因



我正在尝试设置一个基于Windows Server的持续集成服务器,以完全构建和打包Unreal Engine 4项目。绝大多数过程都是有效的,但在内容烹饪阶段,我不断遇到以下错误:

********** COOK COMMAND STARTED **********
Running UE4Editor Cook for project C:workspaceCEIT_ingame-native-plugins_PR-44sampleProjectsunrealShooterGame26ShooterGame.uproject
Commandlet log file is C:Unreal426WindowsEngineProgramsAutomationToolSavedCook-2021.07.05-13.56.23.txt
Running: C:Unreal426WindowsEngineBinariesWin64UE4Editor-Cmd.exe C:workspaceCEIT_ingame-native-plugins_PR-44sampleProjectsunrealShooterGame26ShooterGame.uproject -run=Cook  -TargetPlatform=WindowsClient -fileopenlog -ddc=DerivedDataBackendGraph -unversioned -abslog=C:Unreal426WindowsEngineProgramsAutomationToolSavedCook-2021.07.05-13.56.23.txt -stdout -CrashForUAT -unattended -NoLogTimes  -UTF8Output
LogInit: Display: Running engine for game: ShooterGame
LogModuleManager: Warning: ModuleManager: Unable to load module 'C:/Unreal426/Windows/Engine/Binaries/Win64/UE4Editor-OpenGLDrv.dll' because the file couldn't be loaded by the OS.
LogModuleManager: Warning: ModuleManager: Unable to load module 'C:/Unreal426/Windows/Engine/Plugins/Lumin/MagicLeap/Binaries/Win64/UE4Editor-MagicLeap.dll' because the file couldn't be loaded by the OS.
Took 14.257796s to run UE4Editor-Cmd.exe, ExitCode=1
ERROR: Cook failed.
(see C:UsersjenkinsAppDataRoamingUnreal EngineAutomationToolLogsC+Unreal426+WindowsLog.txt for full exception trace)
AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)
BUILD FAILED

具体来说,UE4Editor-OpenGLDrv.dllUE4Editor-MagicLeap.dll不能被加载,但没有任何明确的指示来说明为什么会这样,只是";该文件不能由OS加载";。写入磁盘的日志文件只告诉我上面的信息。我已经验证了这两个DLL实际上都存在于CI服务器上,因此我怀疑缺少其他一些子依赖项。

我曾尝试在Unreal可执行文件和日志中提到的DLL上运行Dependencies,以确定服务器机器本身可能缺少哪些DLL,但这需要三个多小时才能运行完成,因此重复执行有点尴尬和耗时。我遵循了本页中关于缺少依赖项的建议,并查看了所有可能的DLL,这些DLL被报告为依赖项实用程序找不到(主要是与DirectX/OpenGL相关的DLL(,但构建仍然失败,我的想法也不多了。

在Windows中有什么简单的方法可以准确地找出DLL加载失败的原因吗?我似乎记得Windows DLL加载错误消息的信息远不如Linux,但也许有一种我不熟悉的工具或更简单的方法可以解决它。


EDIT:我已经缩小了范围-如果我试图在自己的程序中完全动态地加载glu32.dll,我会得到加载错误Could not load C:WindowsSystem32glu32.dll: The specified procedure could not be found.。因为这是在加载尝试中,而不是试图查找函数,这意味着glu32.dll的子依赖项上缺少了一些过程,但我不知道该如何识别它是哪一个。

如果使用UE源代码启动,请参阅UE文档并使用Visual Studio重新生成,则可以尝试删除Engine/Intermediate并单击GenerateProjectFiles.bat以重新生成整个项目。如果您使用UE4编辑器启动时缺少dll,只需像第三方一样在YourProject.build.cs中添加依赖项,请参阅UE文档。

最新更新