How to inherit light class?

Not sure how to do this. I’m proceeding as I would do for any other c++ class. In my project I do File > Add code to project and then select “PointLight” as my parent class. Unfortunately my code refuse to compile for this point.

I get multiple link error because of unresolved external symbols. It’s looks like my custom light class is unable to inherit properly from it’s parent. Any ideas why ?

Also I don’t see any constructor, so I’m not sure what to add in my body (*.cpp) to be able to change some default values of the PointLight.

Performing 1 actions (4 in parallel)
[1/1] Link UE4Editor-Exil.dll
   Creating library V:\UE4Projects\Exil\Intermediate\Build\Win64\ExilEditor\Development\UE4Editor-Exil.lib and object V:\UE4Projects\Exil\Intermediate\Build\Win64\ExilEditor\Development\UE4Editor-Exil.exp
ExilPointLight.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl APointLight::EditorApplyScale(struct FVector const &,struct FVector const *,bool,bool,bool)" (?EditorApplyScale@APointLight@@UEAAXAEBUFVector@@PEBU2@_N22@Z)
Exil.generated.cpp.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl APointLight::EditorApplyScale(struct FVector const &,struct FVector const *,bool,bool,bool)" (?EditorApplyScale@APointLight@@UEAAXAEBUFVector@@PEBU2@_N22@Z) referenced in function "class UFunction * __cdecl Z_Construct_UFunction_AExilCharacter_IsUsingInkPower(void)" (?Z_Construct_UFunction_AExilCharacter_IsUsingInkPower@@YAPEAVUFunction@@XZ)
ExilPointLight.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl APointLight::PostLoad(void)" (?PostLoad@APointLight@@UEAAXXZ)
Exil.generated.cpp.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl APointLight::PostLoad(void)" (?PostLoad@APointLight@@UEAAXXZ) referenced in function "void __cdecl `dynamic initializer for 'AutoInitializeAExilPlayerCamera''(void)" (??__EAutoInitializeAExilPlayerCamera@@YAXXZ)
ExilPointLight.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl APointLight::LoadedFromAnotherClass(class FName const &)" (?LoadedFromAnotherClass@APointLight@@UEAAXAEBVFName@@@Z)
Exil.generated.cpp.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl APointLight::LoadedFromAnotherClass(class FName const &)" (?LoadedFromAnotherClass@APointLight@@UEAAXAEBVFName@@@Z) referenced in function "void __cdecl GetPrivateStaticClassBody<class UExilMovementComponent>(wchar_t const *,wchar_t const *,class UClass * &,void (__cdecl*)(void))" (??$GetPrivateStaticClassBody@VUExilMovementComponent@@@@YAXPEB_W0AEAPEAVUClass@@P6AXXZ@Z)
V:\UE4Projects\Exil\Binaries\Win64\UE4Editor-Exil.dll : fatal error LNK1120: 3 unresolved externals
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: V:\UE4Projects\Exil\Binaries\Win64\UE4Editor-Exil.dll
Cumulative action seconds (8 processors): 0,00 building projects, 0,00 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,20 linking, 0,00 other
UBT execution time: 15,38 seconds

Solution : tag the function in APointLight with ENGINE_API.
Too bad this is not the case by default, this make inherited light class impossible without modifying the engine code.

In my case I wanted to change some default light settings for a custom project only. :
Blueprints are also too cumbersome for this case as they can’t manage the static/stationary/mobility settings.

Hi, I have the same error, could you explain more detailed the solution implementation?

Thx.