# Linker error creating my own SceneCaptureComponents2D class

**URL:** <https://forums.unrealengine.com/t/linker-error-creating-my-own-scenecapturecomponents2d-class/320253>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 31, 2015, 2:22am UTC](https://forums.unrealengine.com/t/linker-error-creating-my-own-scenecapturecomponents2d-class/320253 "2015-05-31T02:22:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrdid456](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrdid456](https://forums.unrealengine.com/u/mrdid456)\
**Post date:** [May 31, 2015, 2:22am UTC](https://forums.unrealengine.com/t/linker-error-creating-my-own-scenecapturecomponents2d-class/320253/1 "2015-05-31T02:22:28Z")

</div>

Hi i am trying to make my own class deriving from SceneCaptureComponent2D using:  
#include “Components/SceneCaptureComponent2D.h”  
and then i have:  
#include “CaptureComponent2D.generated.h”

UCLASS()  
class UCaptureComponent2D : public USceneCaptureComponent2D  
{  
GENERATED\_UCLASS\_BODY()

};

I feel like i am missing a step that is not obvious. i am trying to use this in creating a mini-map and feel a little lost. the way i understand it a basic class creation like this should work as i have it working for a SceneCapture2D class with no problems.

P.S my error reads:  
Error 1 error LNK2019: unresolved external symbol “public: static void \_\_cdecl USceneCaptureComponent::AddReferencedObjects(class UObject \*,class FReferenceCollector &)” (?AddReferencedObjects@USceneCaptureComponent@@SAXPEAVUObject@@AEAVFReferenceCollector@@@Z) referenced in function “void \_\_cdecl GetPrivateStaticClassBody(wchar\_t const \*,wchar\_t const _,class UClass \* &,void (\_\_cdecl_)(void))” (??$GetPrivateStaticClassBody@VUCaptureComponent2D@@@@YAXPEB\_W0AEAPEAVUClass@@P6AXXZ@Z)

---

<div class="post-metadata">

**Author:** ![mrdid456](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrdid456](https://forums.unrealengine.com/u/mrdid456)\
**Post date:** [June 2, 2015, 10:26am UTC](https://forums.unrealengine.com/t/linker-error-creating-my-own-scenecapturecomponents2d-class/320253/2 "2015-06-02T10:26:17Z")

</div>

this error has admittedly morphed into something else and am now getting linker errors about not being able to find functions from the inherited class USceneCaptureComponent2D despite that i explicitly show the class where to find it. i have no problems inheriting from other classes just this one seems to give me trouble…any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8e2766aa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8e2766aa](https://forums.unrealengine.com/u/anonymous_user_8e2766aa)\
**Post date:** [June 9, 2015, 4:39pm UTC](https://forums.unrealengine.com/t/linker-error-creating-my-own-scenecapturecomponents2d-class/320253/3 "2015-06-09T16:39:30Z")

</div>

Hello, mrdid456

I am sorry to hear about your issue.

To fix it please add ENGINE\_API macro before declarations of following methods:

1. PostLoad(), AddReferencedObjects() in SceneCaptureComponent.h;

2. SendRenderTransform\_Concurrent(), RequiresGameThreadEndOfFrameUpdates(), TickComponent(), PostEditChangeProperty(), UpdateContent() and UpdateDeferredCaptures() in SceneCaptureComponent2D.h.

Hope this helped!

Good luck!

---

<div class="post-metadata">

**Author:** ![Greg\_G\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Greg\_G\_1](https://forums.unrealengine.com/u/Greg_G_1)\
**Post date:** [August 31, 2017, 3:35pm UTC](https://forums.unrealengine.com/t/linker-error-creating-my-own-scenecapturecomponents2d-class/320253/4 "2017-08-31T15:35:18Z")

</div>

Hi Andrii,

I’m using UE version 4.13.2 and I’m experiencing the same problem as mrdid456. Seems to me that these macro should be added to the engine so that users like myself do not need to create modifications to the engine that need to be merged everytime we upgrade UE. I see that UE 4.17 was just released. Can you tell me if these changes have been applied to any engine version after 4.13.2?

Regards,
