How to package a plugin that contains no cpp files?

I’m currently trying to package a plugin that only contains the generated files and optionally the headers. Packaging with c++ code is fine but what are my futher steps?
I can’t find any documentation and the links on the web didn’t work for me.

Generate an external *.lib file in Visual Studio and link it to your plugin’s runtime module.

Can you elaborate? The package step already generates the libs so I guess this is fine?

What is the problem exactly?
Are you getting errors when trying to package your project in the editor or through command line?
Not having any CPP files in your plugin shouldn’t be preventing packaging.

If you use regular C++, indeed, there should be no problem if you remove the CPPs. However, if you use UE4/reflected C++ you will need to mark certain members as “Virtual”, such as “PURE_VIRTUAL void Something();” or something. I don’t remember the exact syntax/macros, but they can be Googled. Without them, UHT will search for implementations and, typically, without CPPs, it will fail there.

Edit: How do I implement Pure Virtual Methods? - Programming & Scripting - Unreal Engine Forums

To clarify:
I’ve build a ue4 plugin with the ue4 stuff like UCLASS, UPROPERY etc. This is not a plain C++ plugin.
When I package it from the plugins menu in my sample scene it generates all the necessary binaries and libs in the respective folders
But when I delete the C++ code from the plugin and try to package the game in debug mode then it doesn’t compile anymore.

Plugins have build configurations just as projects do. You can’t expect to compile a plugin in “DevelopmentEditor” and then for it to work inside a “DevelopmentDebug” project.

1 - Compile everything in whatever configuration you want.
2 - When you delete the source, do not delete the “.uplugin” file!

But isn’t a plugin built for all targets automatically when I package it?

Not for all of them, no. Assuming you are working from the VS solution of your project, which includes the engine (and, indirectly, the plugin, whether it’s engine-side or project-side), that’s where you set the “DevelopmentDebug” configuration and make sure the plugin is enabled in your project (otherwise it will be ignored). Then, you will find the binaries named “UE4Client-YourModule.dll” (or maybe slightly different, but the configuration name will be appended there; “UE4Client” is the result of “DevelopmentClient”). and that’s when you decide what H/CPP files to delete or not. The only things that need to remain are:

1 - The binaries.
2 - The “.uplugin” descriptor.

And again, if you use reflected code in the headers which you plan to redistribute, mark the members accordingly (i.e. functions as “virtual”). I’m not sure if there is anything I’m missing, but that’s the theory.

Thanks vlad.serbanescu11 for your time!

I’ve checked my packaged plugins folder and can only see UE4Editor-MyPlugin.dll (+ the corresponding pdb file). Which means that only the shipping version will build right since it doesn’t contain any appendix (like -Win64-DebugGame).

I’ll try to simply copy the debug game dll and test whether it works next week or so but thanks again for taking the time to explain it to me!