Error Compiling newly created plugin

I created a new project and created a plugin called ‘Logger’ using blank template
When I compile my project now I am getting an error
I didn’t even add or change anything in cpp files
Why I am getting this error?
I am using Unreal 5.4

Hello @sudha2210200211

Error “unresolved externals” means that your code uses elements or some methods for which the compiler cannot find definitions.

Did you create a plugin and just compile it in the development environment without changing anything?

When you created the plugin, there were no errors and the development environment opened?

What I did was

  1. created a cpp project (vs code opened)
  2. Created a blank plugin named ‘Logger’ (‘Logger’ plugin appeared in vs code)
  3. Recompiled the project
    I didn’t write a single logic or created any other assets. Just the blank plugin itself causing error.
    I don’t know what I am doing wrong…I am new to cpp and plugins…Spent half day tring to resolve, but can’t resolve it

@sudha2210200211

It looks like this error is only in Visual Studio. If the plugin opened in the development environment, then the Unreal engine compiled it and the plugin works.

Try to ignore Visual Studio errors and recompile the plugin through the Unreal engine itself by clicking here:

You can use live coding or turn it off and compile only when you click this button manually:

But I recompiled using unreal only, that’s what giving me this error.

Have you tried creating a plugin in another project? sometimes it can help

Can you copy the error text and send it as a message?
Also, can you take screenshots of the plugin code, including the .uplugin and .build.cs files?

I tried on more new project and also tried in unreal 5.3.2, same issue.
Wait I will share more screenshots

Try turning off live coding (it doesn’t work with larger changes in the project).
Check that your plugin is enabled inside of your uproject file

it should look something like this inside the plugin area:

	"Plugins": [
		{
	"Name": "Logger",
			"Enabled": true
		}

If it’s there and set to enabled then try compiling & running your project from your IDE (it’s needed to compile the plugin)

The error in the first post clearly looks like a live coding window & that won’t cut it.

Creating Blank project


Project created and Vs code opened


Creating blank pugin ‘SamplePlugin’

Plugin created and vs code asks to reload project


After reloading the plugin is visible in vs code
image
Here I attached the Plugin Files generated
SamplePlugin.zip (12.1 MB)
Without changing anything hit recompile in engine

Registered restarted process C:\Program Files\Epic Games\UE_5.4\Engine\Binaries\Win64\UnrealEditor.exe (PID: 16732, previous PID: 15528)
Loading module D:\Unreal Projects\MyProject\Binaries\Win64\UnrealEditor-MyProject.dll (0.085 MB)
Loaded 1 module(s), 702 lazy load module(s), and 554 reserved page ranges (0.000s, 5 translation units)
Live coding ready - Save changes and press Ctrl+Alt+F11 to re-compile code
Loading module D:\Unreal Projects\MyProject\Plugins\SamplePlugin\Binaries\Win64\UnrealEditor-SamplePlugin.dll (0.046 MB)
Loaded 1 module(s), 0 lazy load module(s), and 0 reserved page ranges (0.000s, 2 translation units)
Manual recompile triggered
---------- Creating patch ----------
Running C:\Program Files\Epic Games\UE_5.4\Engine\Build\BatchFiles\Build.bat -Target="MyProjectEditor Win64 Development -Project=""D:/Unreal Projects/MyProject/MyProject.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
  Using bundled DotNet SDK version: 6.0.302
  Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" -Target="MyProjectEditor Win64 Development -Project=""D:/Unreal Projects/MyProject/MyProject.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.
  Log file: C:\Users\sudha\AppData\Local\UnrealBuildTool\Log.txt
  Invalidating makefile for MyProjectEditor (Definitions.SamplePlugin.h modified)
  Building MyProjectEditor...
  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.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
  [Upgrade]
  [Upgrade] Using backward-compatible include order. The latest version of UE has changed the order of includes, which may require code changes. The current setting is:
  [Upgrade]     IncludeOrderVersion = EngineIncludeOrderVersion.Oldest
  [Upgrade] Suppress this message by setting 'IncludeOrderVersion = EngineIncludeOrderVersion.Latest;' in MyProjectEditor.Target.cs.
  [Upgrade] Alternatively you can set this to 'EngineIncludeOrderVersion.Latest' to always use the latest include order. This will potentially cause compile errors when integrating new versions of the engine.
  [Upgrade]
  [Adaptive Build] Excluded from SamplePlugin unity file: SamplePlugin.cpp
  Determining max actions to execute in parallel (4 physical cores, 8 logical cores)
    Executing up to 4 processes, one per physical core
    Requested 1.5 GB memory per action, 482.21 MB available: limiting max parallel actions to 1
  Using Parallel executor to run 1 action(s)
  ------ Building 1 action(s) started ------
  [1/1] Compile [x64] SamplePlugin.cpp
  Total time in Parallel executor: 108.67 seconds
  Total execution time: 115.14 seconds
File D:\Unreal Projects\MyProject\Plugins\SamplePlugin\Intermediate\Build\Win64\x64\UnrealEditor\Development\SamplePlugin\SamplePlugin.cpp.obj was modified or is new
Building patch from 1 file(s) for Live coding module D:\Unreal Projects\MyProject\Plugins\SamplePlugin\Binaries\Win64\UnrealEditor-SamplePlugin.dll
   Creating library D:\Unreal Projects\MyProject\Plugins\SamplePlugin\Binaries\Win64\UnrealEditor-SamplePlugin.patch_0.lib and object D:\Unreal Projects\MyProject\Plugins\SamplePlugin\Binaries\Win64\UnrealEditor-SamplePlugin.patch_0.exp
SamplePlugin.cpp.obj : error LNK2011: precompiled object not linked in; image may not run
D:\Unreal Projects\MyProject\Plugins\SamplePlugin\Binaries\Win64\UnrealEditor-SamplePlugin.patch_0.exe : fatal error LNK1120: 1 unresolved externals
Failed to link patch (0.000s) (Exit code: 0x460)
---------- Finished (0.000s) ----------

If you follow this is this working for you?
If so then maybe something is broken in my system, maybe I need to uninstall everything and install again?

Works no problem i 5.4

Close your editor and run you IDE. Build & run your project. It’s probably just live coding interfering with your compile. You can’t compile in VS or Rider while having Live Coding enabled at the same time.

Here’s a solution explorer view

Also make sure you reload your project in VS if it asked you after the plugin creation is complete. It needs to refresh the project.

1 Like

@3dRaven you are a lifesaver
Closing the engine and, build & run from IDE solved the problem

1 Like