Can not package my project due to plugin dll locked by UE4Editor

Can not package my project, because one of my plugin dll’s got locked by UE4Editor, and it reports that it can not build it.
4.10 was ok.

Or not because of this.

Log looks like this

Performing 4 actions (6 in parallel)
[1/4] Link UE4-GeographicPlugin.lib
[2/4] Link UE4-SomeLib.lib
[3/4] Link UE4-SomeLibOther.lib
[4/4] Link UE4-RotorPhysics.lib
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: F:\Project.4.11\Plugins\GeographicPlugin\Binaries\Win64\UE4-GeographicPlugin.lib

Yep, I think that is because my rocket build was incomplete. Ticket can be closed.

No, it still fails. :expressionless:

What is strange it already linked an .exe, but still fails on that library

MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: [20/24] Link Geal-GeographicPlugin.lib
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: [21/24] Link Geal-SomeLib.lib
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: [22/24] Link Geal-RotorPhysics.lib
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: [23/24] Link Geal-SomeOtherLib.lib
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: [24/24] Link Game.exe
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: DJIProtocolLib-Win64-Release.lib(ROObject.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool:    Creating library F:\Geal.4.11\Binaries\Win64\Geal.lib and object F:\Geal.4.11\Binaries\Win64\Geal.exp
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Generating code
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Finished generating code
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: F:\Geal.4.11\Plugins\GeographicPlugin\Binaries\Win64\Geal-GeographicPlugin.lib
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Total build time: 347.81 seconds
  •   [0]	{C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\../../VC/bin/amd64\lib.exe -  /NOLOGO /errorReport:prompt /MACHINE:x64 /SUBSYSTEM:WINDOWS @"F:\Geal.4.11\Plugins\GeographicPlugin\Intermediate\Build\Win64\Geal\Development\Geal-GeographicPlugin.lib.response" /OUT:"F:\Geal.4.11\Plugins\GeographicPlugin\Binaries\Win64\Geal-GeographicPlugin.lib"}	UnrealBuildTool.Action
    •   [1]	{C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\../../VC/bin/amd64\lib.exe -  /NOLOGO /errorReport:prompt /MACHINE:x64 /SUBSYSTEM:WINDOWS @"F:\Geal.4.11\Plugins\DjiAltizure\Intermediate\Build\Win64\Geal\Development\Geal-DjiAltizure.lib.response" /OUT:"F:\Geal.4.11\Plugins\DjiAltizure\Binaries\Win64\Geal-DjiAltizure.lib"}	UnrealBuildTool.Action
    •   [2]	{C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\../../VC/bin/amd64\lib.exe -  /NOLOGO /errorReport:prompt /MACHINE:x64 /SUBSYSTEM:WINDOWS @"F:\Geal.4.11\Plugins\RotorPhysicsPlugin\Intermediate\Build\Win64\Geal\Development\Geal-RotorPhysics.lib.response" /OUT:"F:\Geal.4.11\Plugins\RotorPhysicsPlugin\Binaries\Win64\Geal-RotorPhysics.lib"}	UnrealBuildTool.Action
    •   [3]	{C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\../../VC/bin/amd64\lib.exe -  /NOLOGO /errorReport:prompt /MACHINE:x64 /SUBSYSTEM:WINDOWS @"F:\Geal.4.11\Plugins\DJIRealDronePlugin\Intermediate\Build\Win64\Geal\Development\Geal-DJIRealDrone.lib.response" /OUT:"F:\Geal.4.11\Plugins\DJIRealDronePlugin\Binaries\Win64\Geal-DJIRealDrone.lib"}	UnrealBuildTool.Action

This are ActionsToExecute generated by UnrealBuildTool. If I run them in command line lib.exe complains on bad option -

Microsoft (R) Library Manager Version 14.00.23918.0
Copyright (C) Microsoft Corporation.  All rights reserved.

LINK : fatal error LNK1117: syntax error in option ''

No that is not the reason. For some reason F:\Geal.4.11\Plugins\GeographicPlugin\Intermediate\Build\Win64\Geal\Development\Geal-GeographicPlugin.lib.response is empty, i think that is the case. For UE4Editor builds it contains some data.

[Here is the simple project I can not pack][1]

89626-myproject.rar (1.31 MB)

I think this patch to UnrealBuildTool resolves the problem. Not sure if AddModule should be called in Binary is not null. But project can be packed now. Or maybe AddExtraModules() should be patched to test Module.Binary == null, like that is done in PreBuildSetup(), so i am not sending patch to UE. Epics, you should check this by yourself I think.

diff --git a/Engine/Source/Programs/UnrealBuildTool/Configuration/UEBuildTarget.cs b/Engine/Source/Programs/UnrealBuildTool/Configuration/UEBuildTarget.cs
index 6473b3c..a5275f2 100644
--- a/Engine/Source/Programs/UnrealBuildTool/Configuration/UEBuildTarget.cs
+++ b/Engine/Source/Programs/UnrealBuildTool/Configuration/UEBuildTarget.cs
@@ -3091,8 +3091,11 @@ namespace UnrealBuildTool
                        if (ShouldCompileMonolithic())
                                // When linking monolithically, any unbound modules will be linked into the main executable
-                               Module.Binary = (UEBuildBinaryCPP)AppBinaries[0];
-                               Module.Binary.AddModule(Module);
+                               if (Module.Binary == null)
+                               {
+                                       Module.Binary = (UEBuildBinaryCPP)AppBinaries[0];
+                                       Module.Binary.AddModule(Module);
+                               }


Are you able to package your project or any new project without this specific plugin included? We do not provide support for third-party plugins and I have not seen a GeographicPlugin.lib in any of my files when searching.

Please provide additional information, included fully updated logs.


Hello, ,

that is the problem with Unreal build tools, I attached a test project in one of answers. And also a patch how to fix it.