I’m trying to package my own C++ plugin using Unreal Engine 4.20 and afterwards strip out some of the source code, while still leaving binaries so the plugin can be used with editor and game distributions. (This is a requirement for my company for IP protection, so please don’t respond if you’d like to suggest not doing this - it’s out of my control and I love FOSS as much as the next guy. Business gonna business.)
It seems this process may have changed in the last few engine versions. I’ve got plugin examples here from earlier engine versions of this setup working so I know it’s possible. In these examples, the plugin’s Source*\Private folders were deleted, but as long as the plugin still contains the Source*.Build.cs files and Source*\Public files, and also contains Binaries\Win64*.dll/lib for all build configurations + platforms, I can rebuild a C++ project hosting the plugin in Visual Studio or via UE4’s automatic rebuild process when opening the .uproject file, and I get no warnings or errors.
There’s some prior discussion of getting this working here, though I haven’t found a single clear tutorial or step-by-step guide on how to do it:
In 4.20 this process doesn’t seem to work, though I’m not 100% sure of the correct steps, and there’s no real documentation I can find on it. I think all I’m supposed to do is remove the Source\Private folders. But if I package the plugin via the editor, strip out the private source files, then add it to a C++ project and build the “Development Editor” profile in Visual Studio I see:
1>UnrealBuildTool : error : UBT ERROR: Failed to produce item: <MYPROJECT>\Plugins<MYPLUGIN>\Intermediate\Build\Win64\UE4Editor\Development<MODULEINSIDETHEPLUGIN>\UE4Editor-<MODULEINSIDETHEPLUGIN>.suppressed.exp
1> (see …/Programs/UnrealBuildTool/Log.txt for full exception trace)
The UnrealBuildTool log file gives no further clues.
The other thing I’ve noticed that seems odd is that packaging my plugin does not generate .lib files under Binaries\Win64, only .dll files. I would have expected .lib files for the Development, Shipping builds etc. So I’m wondering if this is part of the problem.
I’ve read through Plugins | Unreal Engine Documentation and had a dig through old forum threads/AnswerHub responses, but I couldn’t find a clear tutorial or example on how to do this.
Any pointers greatly appreciated!