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

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.

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.