LNK2019 errors when building standalone with plugin
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:
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.
asked Oct 03 '14 at 06:33 PM in Packaging & Deployment
Found the problem! It was in my ___Plugin.cpp file, where the IMPLEMENT_MODULE macro is used. I was giving it Module as the second argument (not sure where that came from, probably copied from sample code), when it should have been given MyPlugin.
answered Oct 06 '14 at 10:18 PM
I also ran into this problem and it took me a bit to figure out. Your solution wasn't the same as my solution.
My issue: in my root folder I have a source file which is named [ProjectName].cpp (in my case, "magemaster2.cpp"). Within there, was a line which said:
This is wrong. The game module needs to reflect the project name, so I changed it to:
and it worked.
I have no idea how this got changed or why it wasn't causing problems in the past. Regardless, this is where you should look if you get these types of linker errors.
answered Feb 04 '15 at 08:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here