I created a project from one of the pre-made samples (third person shooter, specifically), and created a very simple plugin which would print the FPS as a debug message. I’m trying to compile it as a standalone executable. It works in Play In Editor, but when trying to Launch the game from the editor or build from Visual Studio using the Development configuration (as opposed to DevelopmentEditor) it fails. I get the following error:
1>UELinkerFixups.cpp.obj : error LNK2019: unresolved external symbol "void __cdecl EmptyLinkFunctionForStaticInitializationMyPlugin(void)" (?EmptyLinkFunctionForStaticInitializationMyPlugin@@YAXXZ) referenced in function "void __cdecl UELinkerFixups(void)" (?UELinkerFixups@@YAXXZ)
1>C:\Users\cognimancer\Documents\Unreal Projects\AppTest0\Binaries\Win64\AppTest.exe : fatal error LNK1120: 1 unresolved externals
On the other hand, when I right click the MyPlugin.uproject file and select Launch Game, it launches in a window - looks a lot like a standalone exe, but I don’t see an executable being generated anywhere.
What might be causing this? The plugin uses no third party libraries, and removing the FPS printout code doesn’t help it run. It looks like a problem between the engine and the plugin, but the plugin works fine in the editor. I’ve tried DebugGame and Development configs, both in x64.
The plugin is as barebones as I can make it, pretty much just the minimum code needed for a plugin.
MyPlugin.Build.cs
using UnrealBuildTool;
using System.IO;
public class MyPlugin : ModuleRules
{
Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
public MyPlugin(TargetInfo Target)
{
PrivateIncludePaths.AddRange(new string[] { "MyPlugin/Private", "MyPlugin/Classes" });
PublicDependencyModuleNames.AddRange(new string[] { "Engine", "Core", "CoreUObject" });
}
}
MyPlugin.uplugin
{
"FileVersion" : 1,
"FriendlyName" : "Test Plugin",
"Version" : 1,
"VersionName": "1.0",
"EngineVersion" : "4.4",
"Description" : "Prints FPS to screen."
"Category" : "Runtime",
"CreatedBy" : "cognimancer",
"Modules" :
[
{
"Name" : "MyPlugin",
"Type" : "Runtime"
}
]
}