Pak C++ plugin

I am creating a mod for my game, and I have trouble packaging the native classes of the plugin.

I am able to cook my plugin into a .pak, and use the blueprints/other assets in there in my game without issues, but the native classes are missing, giving me errors like this:

[182]LogStreaming:Warning: FAsyncPackage::LoadImports for /OtherMod/B5: Skipping import Default__MyActor, depends on missing native class
[AsyncLoading.cpp][Line: 2936] Missing dependency, request for MyActor but it hasn't been created yet.

I am guessing that the dll is not cooked into the .pak.
I tried to put my plugin dll in the same folder as the game .exe, but no luck.

Is there a way to pack C++ plugins?

Unreal has functionality for dynamic load of DLLs, but I don’t think you can call any functions from it without having the header compiled with the main game, for the signatures.

So perhaps a way would be to have your main code load DLLs created from the same base class, so the main game can know it. Then, for each different DLL, there’d be an extension of this base class that knows how to work with other new code. But I have no idea how you’d separate the compilation of DLC vs base code in Unreal. It compiles all code in the project for the base game. Unless you had DLC code in a separate project, but then the main one might not have the slightest idea on how to access it.

Usually DLCs are only new Assets, with classes based on classes from the base game only.