# Can't instantiate my custom UActorComponent from plugin. LNK2019.

**URL:** <https://forums.unrealengine.com/t/cant-instantiate-my-custom-uactorcomponent-from-plugin-lnk2019/408517>\
**Category:** Plugins\
**Tags:** lnk2019, unreal-engine, Plugins, question\
**Created:** [November 1, 2017, 11:40pm UTC](https://forums.unrealengine.com/t/cant-instantiate-my-custom-uactorcomponent-from-plugin-lnk2019/408517 "2017-11-01T23:40:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kochab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kochab](https://forums.unrealengine.com/u/Kochab)\
**Post date:** [November 1, 2017, 11:40pm UTC](https://forums.unrealengine.com/t/cant-instantiate-my-custom-uactorcomponent-from-plugin-lnk2019/408517/1 "2017-11-01T23:40:55Z")

</div>

I’m getting a `LNK2019` error when I try to run this line of code in a pawn constructor:

```
customComp = CreateDefaultSubobject<UMyCustomComponent>(TEXT("custom"));

```

Here is the error:

```
error LNK2019: unresolved external symbol "__declspec(dllimport) private: static class UClass *__cdecl UMyCustomComponent::GetPrivateStaticClass(void)"

```

My custom component is being imported via a plugin. It extends from `UActorComponent`. I can already include  
`MyCustomComponent.h` into my pawn. I just can’t instantiate it for some reason.

---

<div class="post-metadata">

**Author:** ![Kochab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kochab](https://forums.unrealengine.com/u/Kochab)\
**Post date:** [November 2, 2017, 3:59pm UTC](https://forums.unrealengine.com/t/cant-instantiate-my-custom-uactorcomponent-from-plugin-lnk2019/408517/2 "2017-11-02T15:59:51Z")

</div>

I deleted the `Intermediate` folders in both my project and plugin directory and my project all of a sudden compiles again. I tried that out because yesterday my code would compile when I commented that line in my pawn’s constructor. Today it wouldn’t! That told me something wonky was going on. Anyway, I’m glad it worked.
