Editor Toolbar Button: Always get error LNK2011: precompiled object not linked in; image may not run

Hi all,

Whenever I try to make a new plugin as a test, even if I don’t change a single thing in Visual Studio, I get this error:

etbCommands.cpp.obj : error LNK2011: precompiled object not linked in; image may not run
F:\UEPROJECTS\makingplugins6\Plugins\etb\Binaries\Win64\UnrealEditor-etb.patch_0.exe : fatal error LNK1120: 1 unresolved externals

Here’s the full Live Coding console report:

---------- Creating patch ----------
Running C:\Program Files\Epic Games\UE_5.4\Engine\Build\BatchFiles\Build.bat -Target="makingplugins6Editor Win64 Development -Project=""F:/UEPROJECTS/makingplugins6/makingplugins6.uproject""" -LiveCoding -LiveCodingModules="C:/Program Files/Epic Games/UE_5.4/Engine/Intermediate/LiveCodingModules.json" -LiveCodingManifest="C:/Program Files/Epic Games/UE_5.4/Engine/Intermediate/LiveCoding.json" -WaitMutex -LiveCodingLimit=100
Quick restart disabled when re-instancing is enabled.
  Using bundled DotNet SDK version: 6.0.302
  Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" -Target="makingplugins6Editor Win64 Development -Project=""F:/UEPROJECTS/makingplugins6/makingplugins6.uproject""" -LiveCoding -LiveCodingModules="C:/Program Files/Epic Games/UE_5.4/Engine/Intermediate/LiveCodingModules.json" -LiveCodingManifest="C:/Program Files/Epic Games/UE_5.4/Engine/Intermediate/LiveCoding.json" -WaitMutex -LiveCodingLimit=100
  Log file: C:\Users\toby\AppData\Local\UnrealBuildTool\Log.txt
  Creating makefile for makingplugins6Editor (command line arguments changed)
  Building makingplugins6Editor...
  Using Visual Studio 2022 14.38.33135 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
  [Adaptive Build] Excluded from etb unity file: etb.cpp, etbCommands.cpp, etbStyle.cpp
  Determining max actions to execute in parallel (12 physical cores, 24 logical cores)
    Executing up to 12 processes, one per physical core
  Using Parallel executor to run 3 action(s)
  ------ Building 3 action(s) started ------
  [1/3] Compile [x64] etbCommands.cpp
  [2/3] Compile [x64] etb.cpp
  [3/3] Compile [x64] etbStyle.cpp
  Total time in Parallel executor: 1.34 seconds
  Total execution time: 4.20 seconds
File F:\UEPROJECTS\makingplugins6\Plugins\etb\Intermediate\Build\Win64\x64\UnrealEditor\Development\etb\etb.cpp.obj was modified or is new
File F:\UEPROJECTS\makingplugins6\Plugins\etb\Intermediate\Build\Win64\x64\UnrealEditor\Development\etb\etbCommands.cpp.obj was modified or is new
File F:\UEPROJECTS\makingplugins6\Plugins\etb\Intermediate\Build\Win64\x64\UnrealEditor\Development\etb\etbStyle.cpp.obj was modified or is new
Building patch from 3 file(s) for Live coding module F:\UEPROJECTS\makingplugins6\Plugins\etb\Binaries\Win64\UnrealEditor-etb.dll
   Creating library F:\UEPROJECTS\makingplugins6\Plugins\etb\Binaries\Win64\UnrealEditor-etb.patch_0.lib and object F:\UEPROJECTS\makingplugins6\Plugins\etb\Binaries\Win64\UnrealEditor-etb.patch_0.exp
etbCommands.cpp.obj : error LNK2011: precompiled object not linked in; image may not run
F:\UEPROJECTS\makingplugins6\Plugins\etb\Binaries\Win64\UnrealEditor-etb.patch_0.exe : fatal error LNK1120: 1 unresolved externals
Failed to link patch (0.000s) (Exit code: 0x460)
---------- Finished (0.000s) ----------

anyone know how to solve it?

1 Like

Seems that the easiest option is to quit Unreal, quit Visual Studio, and then delete the BINARIES folder from the Unreal Project. Then open the Unreal Project again, and say yes to compiling. For whatever reason, that resolves the issue.

I have a second PC in the office and I just installed 5.4 and created an Editor Toolbar Button and got the same result when trying to live recompile. And once again, deleting BINARIES fixed it. Maybe its a bug?

I’m not a C++ programmer so I’m out of my depth. I’m only taking baby steps because I’m trying to write up a spec document, to get quotes from real programmers on making a plugin for me. :slight_smile:

3 Likes

this was the fix for me too, thank you for sharing your solution!

1 Like

Exactly the same issue and the suggested steps also solved my problem.
Thanks a lot for this. I’ve lost probably an hour or two on this.