Unresolved Externals when extending ATriggerBox

When I make a class inheriting ATriggerBox, without adding any extra code I am getting unresolved external errors:

Error	1	error LNK2001: unresolved external symbol "public: virtual void __cdecl ATriggerBox::EditorApplyScale(class FVector const &,class FVector const *,bool,bool,bool)" (?EditorApplyScale@ATriggerBox@@UEAAXAEBVFVector@@PEBV2@_N22@Z)	C:\Users\\game\Intermediate\ProjectFiles\ConveyorBelt.cpp.obj

Error	2	error LNK2019: unresolved external symbol "public: virtual void __cdecl ATriggerBox::EditorApplyScale(class FVector const &,class FVector const *,bool,bool,bool)" (?EditorApplyScale@ATriggerBox@@UEAAXAEBVFVector@@PEBV2@_N22@Z) referenced in function "class UFunction * __cdecl Z_Construct_UFunction_AScoreKeeper_GetScore(void)" (?Z_Construct_UFunction_AScoreKeeper_GetScore@@YAPEAVUFunction@@XZ)	C:\Users\\game\Intermediate\ProjectFiles\game.generated.cpp.obj

Error	3	error LNK1120: 1 unresolved externals	C:\Users\\game\Binaries\Win64\UE4Editor-game.dll

Hey explosivo-

If we could get a little more information from you it will help in investigating this issue. Which version of the engine are you running? How do you create the new class (are you using the “Add Code to Project” button in the editor)? Is this only happening when extending ATriggerBox or does it happen with other classes? Do you get the same error in a new project?

Hi explosivo,
you got this error because ATriggerBox::EditorApplyScale isn’t exported from the engine but you can override this function and copy to her body code from ATriggerBox::EditorApplyScale :stuck_out_tongue:

Hey ,

I have the same issue with version 4.7.6-2513093+++depot+UE4-Releases+4.7, using VS2013 Express on Windows 8.1. I added the code using “Add Code to Project…” in a, fresh, blank C++ project. I noticed the ATriggerBox class is marked as MinimalAPI, could this be related to “a bug open internally to check and fix deriving from some of our component class types”?

I do not built the Engine myself, so I cannot easily try if removing MinimalAPI fixes the issue.

Hey amcofi-

I can’t say for certain if it is related to the issue you linked to however I have also created a bug report for classes derived from Trigger Base and its subclasses failing to create.

Cheers

I went ahead and added the missing ENGINE_API’s to those functions, sorry for the trouble and thanks for the report!

I’m having the same problem. Whenever I try to make a C++ class based off “None”, it works. But when I try to make a class based off Point Light I get a bunch of unresolved external symbol errors. The first one is

Error 1 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) C:\Users\Documents\Unreal Projects\P7\Intermediate\ProjectFiles\MyLight.cpp.obj P7

How do I fix it? I don’t know how to add ENGINE_API to a function…

Hey -

If you are using a source built version of the engine you should be able to open the PointLight.h engine file and add “ENGINE_API” to the line class (ENGINE_API) APointLight : public ALight