How to create custom Landscape c++ class

I lack some functionality in the default Landscape in Unreal, so I wanted to extend it in my own custom Landscape class. However, when I create a C++ class via the editor, that inherits from Landscape, the class won’t compile (and there is no code of mine in it, yet).

The generated code looks like this.
Header:

#pragma once

#include "CoreMinimal.h"
#include "LandscapeComponent.h"
#include "CustomLandscapeComponent.generated.h"

/**
 * 
 */
UCLASS()
class SENSORSTIM_API UCustomLandscapeComponent : public ULandscapeComponent
{
	GENERATED_BODY()
	
};

.cpp file:

#include "CustomLandscapeComponent.h"

The errors are get are mostly LNK2001 unresolved external symbol ones, one error has about the same message but is LNK2019.

Here is an excerpt of the first few ones:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "public: static void __cdecl ULandscapeComponent::AddReferencedObjects(class UObject *,class FReferenceCollector &)" (?AddReferencedObjects@ULandscapeComponent@@SAXPEAVUObject@@AEAVFReferenceCollector@@@Z) referenced in function "private: static class UClass * __cdecl UCustomLandscapeComponent::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@UCustomLandscapeComponent@@CAPEAVUClass@@XZ)	SensorStim	D:\Dev_SRS\SensorStim\Intermediate\ProjectFiles\CustomLandscapeComponent.gen.cpp.obj	1	
Error	LNK2001	unresolved external symbol "public: virtual bool __cdecl ULandscapeComponent::ComponentIsTouchingSelectionBox(struct FBox const &,struct FEngineShowFlags const &,bool,bool)const " (?ComponentIsTouchingSelectionBox@ULandscapeComponent@@UEBA_NAEBUFBox@@AEBUFEngineShowFlags@@_N2@Z)	SensorStim	D:\Dev_SRS\SensorStim\Intermediate\ProjectFiles\CustomLandscapeComponent.cpp.obj	1	
Error	LNK2001	unresolved external symbol "public: virtual bool __cdecl ULandscapeComponent::ComponentIsTouchingSelectionBox(struct FBox const &,struct FEngineShowFlags const &,bool,bool)const " (?ComponentIsTouchingSelectionBox@ULandscapeComponent@@UEBA_NAEBUFBox@@AEBUFEngineShowFlags@@_N2@Z)	SensorStim	D:\Dev_SRS\SensorStim\Intermediate\ProjectFiles\CustomLandscapeComponent.gen.cpp.obj	1	
Error	LNK2001	unresolved external symbol "public: virtual bool __cdecl ULandscapeComponent::ComponentIsTouchingSelectionFrustum(struct FConvexVolume const &,struct FEngineShowFlags const &,bool,bool)const " (?ComponentIsTouchingSelectionFrustum@ULandscapeComponent@@UEBA_NAEBUFConvexVolume@@AEBUFEngineShowFlags@@_N2@Z)	SensorStim	D:\Dev_SRS\SensorStim\Intermediate\ProjectFiles\CustomLandscapeComponent.cpp.obj	1	
Error	LNK2001	unresolved external symbol "public: virtual bool __cdecl ULandscapeComponent::ComponentIsTouchingSelectionFrustum(struct FConvexVolume const &,struct FEngineShowFlags const &,bool,bool)const " (?ComponentIsTouchingSelectionFrustum@ULandscapeComponent@@UEBA_NAEBUFConvexVolume@@AEBUFEngineShowFlags@@_N2@Z)	SensorStim	D:\Dev_SRS\SensorStim\Intermediate\ProjectFiles\CustomLandscapeComponent.gen.cpp.obj	1	
Error	LNK2001	unresolved external symbol "public: virtual bool __cdecl ULandscapeComponent::GetLightMapResolution(int &,int &)const " (?GetLightMapResolution@ULandscapeComponent@@UEBA_NAEAH0@Z)	SensorStim	D:\Dev_SRS\SensorStim\Intermediate\ProjectFiles\CustomLandscapeComponent.cpp.obj	1	
Error	LNK2001	unresolved external symbol "public: virtual bool __cdecl ULandscapeComponent::GetLightMapResolution(int &,int &)const " (?GetLightMapResolution@ULandscapeComponent@@UEBA_NAEAH0@Z)	SensorStim	D:\Dev_SRS\SensorStim\Intermediate\ProjectFiles\CustomLandscapeComponent.gen.cpp.obj	1	
Error	LNK2001	unresolved external symbol "public: virtual bool __cdecl ULandscapeComponent::IsPrecomputedLightingValid(void)const " (?IsPrecomputedLightingValid@ULandscapeComponent@@UEBA_NXZ)	SensorStim	D:\Dev_SRS\SensorStim\Intermediate\ProjectFiles\CustomLandscapeComponent.cpp.obj	1	

That leads me to my question: How would I go about creating a custom Landscape c++ class?

1 Like