Subclassing AMatineeActor and Linking Issue

I’m trying to create a subclass of AMatineeActor so I can layer on some unique interface functions. Unfortunately, it appears that the virtual functions defined in AMatineeActor are not exposed publicly in the Engine module. I’ve pieced this together since I’m getting a similar error to Rama’s old request:(Compiler linker errors for AAtmosphericFog & UAtmosphericFogComponent->SetSunMultiplier() - Programming & Scripting - Epic Developer Community Forums).

Without any other code defined other than a AOSSMatineeActor which subclasses AMatineeActor and has the proper boiler plate, everything is compiling fine, but upon linking time, I’m getting errors like the following.

...
1>OSSMatineeActor.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl AMatineeActor::CheckPriorityRefresh(void)" (?CheckPriorityRefresh@AMatineeActor@@UEAAXXZ)
1>OSSMatineeActor.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl AMatineeActor::Play(void)" (?Play@AMatineeActor@@UEAAXXZ)
1>OSSMatineeActor.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl AMatineeActor::Stop(void)" (?Stop@AMatineeActor@@UEAAXXZ)
...

Here’s what the boilerplate .h file looks like

#pragma once

#include "OSSEventInterface.h"
#include "Matinee/MatineeActor.h"

#include "OSSMatineeActor.generated.h"

/**
 OSS Custom implementation of MatineeActor
 */
UCLASS(MinimalAPI, NotBlueprintable, config = Game)
class AOSSMatineeActor : public AMatineeActor
{
	GENERATED_UCLASS_BODY()

public:

};

I’d like to know how this is properly done. Is this as simple as adding Matinee/AMatineeActor.h to the public Engine.h? Or is this all a red herring? Is it madness to try to subclass AMatineeActor?

Oh and here’s the boiler plate plugin Build.cs I’m using:

namespace UnrealBuildTool.Rules
 {
     public class OSSStageManager : ModuleRules
     {
         public OSSStageManager(TargetInfo Target)
         {
             PublicDependencyModuleNames.AddRange(
                 new string[] {                    
                      "Core", "CoreUObject", "Engine"
                 }
             );
 
             PrivateDependencyModuleNames.AddRange(
                 new string[] {
                 }
             );
 
 
             PublicIncludePaths.AddRange(
                 new string[] {
                     "OSSStageManager/Public"
                 }
             );
              
             PrivateIncludePaths.AddRange(
                 new string[] {
                     "OSSStageManager/Private"
                 }
             );
         }
     }
 }

AMatineeActor has the “MinimalAPI” flag which supposedly means that it is not possible to call functions or access variables. Only functions with the “ENGINE_API” in front can be accessed.

It’s a bummer. Trying to subclass MatineeActor myself. Setting the MatineeData and manipulating the GroupActorInfos (or the actors controlled by the groups) seems impossible from C++ :/.

Running into this issue myself. Why the heck is anything in the engine not properly exposed for subclassing? What is the rational behind this?

You can modify the class to be ENGINE_API by declaring it as such. I am currently using a custom matinee actor using this method.

According to the UE4 documentation, MinimalAPI is only used to decrease compile time, so if you strip the MinimalAPI specifier and declare the class as ENGINE_API you can inherit from it as normal.

Once the class is declared ENGINE_API you need to remove that namespace for all of the class functions which are using it as they are redundant. Then you’re good to go.

But then I’m sitting on an edited source code. : /

The rational is to hold the size of the exposed stuff low, this will lower compile times and generated code size. You can always use a source build and adapt it to your needs.

That’s correct. =[