Class Inheritance in plugins

I have a plugin with two modules and the following structure:

253805-plugin.png

In TestPlugin I have a dataasset class “UTest.”. This plugin compiles fine with no issues initially.

#pragma once

#include "CoreMinimal.h"
#include "Engine/DataAsset.h"
#include "Runtime/CoreUObject/Public/UObject/UObjectGlobals.h"
#include "Test.generated.h"

/**
 * 
 */

UCLASS()
class NODEPLUGIN_API UTest : public UDataAsset
{
	GENERATED_BODY()


};

But the problem starts when
I ceate a new c++ class derived from UTest into the other module “AnotherPlugin”.

#pragma once

#include "CoreMinimal.h"
#include "TestPlugin/Public/Test.h"
#include "InheritedTest.generated.h"

/**
 * 
 */
UCLASS()
class ANOTHERPLUGIN_API UInheritedTest : public UTest
{
	GENERATED_BODY()
	
	
	
	
};

Suddenly I get a “Cannot open include file: ‘Test.generated.h’: No such file or directory” error.

I have tried the steps proposed to solve this issue in other discussions in this forum: delete plugin bin,save and Intermediate folders and then regenerated the Visual Studio Files for the project, but with no luck.

Creating a new c++ class derived from UTest within the same module works fine.

Is this approach to inherit an Engine generated class from one plugin module to another not possible or am I missing something?

You including incorrectly, you should not include using absolute paths.

Insted you should add dependence to your module “TestPlugin” in “AnotherInherentPlugin”. You should include “Test.h” in InheritedTest.h in also “UObject/UObjectGlobals.h” in Test.h insted of all those full paths

Thanks , that worked just fine!

I’m going nuts trying to get this to work myself. both plugins compile fine on their own, I’ve added dependencies and headers and still I can not get a successful build.

Hi Siditious, could you share some code and describe in what way you don’t get a sucessful build and maybe we can help you.

I’m literally just trying to inherit from plugin classes the same way that I would inherit from ACharacter and I keep getting an ‘unresolved external reference’ error.

Hi Siditious, share some code and it will be easier to help you. Regards Johan