# Can't inherit from actor in plugin that implements a plugin interface

**URL:** <https://forums.unrealengine.com/t/cant-inherit-from-actor-in-plugin-that-implements-a-plugin-interface/476258>\
**Category:** Plugins\
**Tags:** interface, inheritance, unreal-engine, Plugins, question, CPP, linking-error\
**Created:** [December 22, 2020, 3:45am UTC](https://forums.unrealengine.com/t/cant-inherit-from-actor-in-plugin-that-implements-a-plugin-interface/476258 "2020-12-22T03:45:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![name\_tbd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@name\_tbd](https://forums.unrealengine.com/u/name_tbd)\
**Post date:** [December 22, 2020, 3:45am UTC](https://forums.unrealengine.com/t/cant-inherit-from-actor-in-plugin-that-implements-a-plugin-interface/476258/1 "2020-12-22T03:45:23Z")

</div>

I have a plugin, in which I have defined two types.  
The first one is a simple actor extending `APlayerController`

```
UCLASS()
class NETPRIVELEGES_API APrivelegedPlayerController : public APlayerController
{

	GENERATED_BODY()

};

```

The second type is a simple interface:

```
UINTERFACE()
class NETPRIVELEGES_API UCommandHandler : public UInterface
{
	GENERATED_BODY()
};

class NETPRIVELEGES_API ICommandHandler
{
	GENERATED_BODY()

public:

	UFunction* FindCommand(const FString& commandString) const;

	ECommandExecutionStatus ParseArguments(const UFunction* const command, const FString& argString, FCommandArgs& OutArgs) const;

	void ExecuteCommand(const UFunction* const command, const FCommandArgs& commandArgs) const;

};

```

Now, I have a third type in my primary game module, which is anther actor that extends the above `APrivelegedPlayerController`:

```
#include "MyPlugin/PrivelegedPlayerController.h"
...

UCLASS()
class ROCKETPROPELLEDBALL_API ARPBPlayerControllerBase : public APrivelegedPlayerController
{
	GENERATED_BODY()
	
public:

	ARPBPlayerControllerBase();

	UFUNCTION()
	void Command_SanityCheck(const FString& args);

	UFUNCTION()
	void Command_ArgTest(const FString& arg1, int arg2);

};

```

This compiles great, and everything is sunshine and flowers. Now I just want `APrivelegedPlayerController` to implement `ICommandHandler` – it’s signature would change to:

```
class NETPRIVELEGES_API APrivelegedPlayerController : public APlayerController, public ICommandHandler

```

Uh, oh, now all of a sudden I am getting cryptic linking errors…  
(NOTE: I still get the linking errors even after providing implementations of the interface methods)

 ![325381-troubleshoot.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/5/0557db81ba47a717fb5fac9a4494edfeb2769ae1.png)

I have no idea what is causing it, as it seems perhaps this is UHT failing at some step.

Something to note is that even though these are linking errors for unresolved symbols on `APrivelegedPlayerController`, the errors go away if I just change `ARPBPlayerControllerBase` to inherit directly from `APlayerController`, leaving my plugin controller referencing the interface – this ONLY breaks when I inherit the plugin player controller from the main game module.

TL;DR

I get linking errors if I have an actor in my primary game module inheriting from a base actor in my plugin module, only when that base actor implements a plugin interface.

Side note: I gave examples but I tried this out on multiple actors and interfaces. They all result in the same issue.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [December 22, 2020, 5:42pm UTC](https://forums.unrealengine.com/t/cant-inherit-from-actor-in-plugin-that-implements-a-plugin-interface/476258/2 "2020-12-22T17:42:59Z")

</div>

Hi there! You need to add **Engine** module to Public dependencies in your plugin **Build.cs** file. The thing is - you need all stuff about APlayerController to inherit from it. As you can see ([APlayerController | Unreal Engine Documentation](https://docs.unrealengine.com/en-US/API/Runtime/Engine/GameFramework/APlayerController/index.html)) this class is in **Engine** module
