# Linker error when adding variable to Character Class

**URL:** <https://forums.unrealengine.com/t/linker-error-when-adding-variable-to-character-class/449833>\
**Category:** Blueprint\
**Tags:** error, add-variable, unreal-engine, question, Blueprint, CPP\
**Created:** [May 30, 2019, 2:09am UTC](https://forums.unrealengine.com/t/linker-error-when-adding-variable-to-character-class/449833 "2019-05-30T02:09:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr.Pathetic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr.Pathetic](https://forums.unrealengine.com/u/Mr.Pathetic)\
**Post date:** [May 30, 2019, 2:09am UTC](https://forums.unrealengine.com/t/linker-error-when-adding-variable-to-character-class/449833/1 "2019-05-30T02:09:56Z")

</div>

I’ve set up a basic character class and derived a blueprint from it. Everything works correctly until I try to create a new variable in the character class.

Adding just a single float property in the CPP class creates a LINK2019 linker error and even after I go back and delete the variable, compiling again still leaves the linker error.

Is it not possible to add variables to a parent class after a derived blueprint is created? Is it an error on the 4.22 version of Unreal?

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [May 30, 2019, 4:56am UTC](https://forums.unrealengine.com/t/linker-error-when-adding-variable-to-character-class/449833/2 "2019-05-30T04:56:48Z")

</div>

Can you paste full linker error here?

---

<div class="post-metadata">

**Author:** ![Gibitop](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gibitop](https://forums.unrealengine.com/u/Gibitop)\
**Post date:** [May 30, 2019, 7:25am UTC](https://forums.unrealengine.com/t/linker-error-when-adding-variable-to-character-class/449833/3 "2019-05-30T07:25:04Z")

</div>

It’s definitely possible to add variables to a parent class after a derived blueprint is created.  
Can you provide a code sample from your .h file where you are trying to add a variable?

---

<div class="post-metadata">

**Author:** ![Lardo\_Deepdelver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lardo\_Deepdelver](https://forums.unrealengine.com/u/Lardo_Deepdelver)\
**Post date:** [May 30, 2019, 7:34am UTC](https://forums.unrealengine.com/t/linker-error-when-adding-variable-to-character-class/449833/4 "2019-05-30T07:34:45Z")

</div>

Just a educated guess, it might fail because you are only doing a partial rebuild,  
and your normal build is a unity build (everything copied together), which might result in you not including all the necessary headers in all files, which only causes problems if that file is then compiled separately

---

<div class="post-metadata">

**Author:** ![Mr.Pathetic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr.Pathetic](https://forums.unrealengine.com/u/Mr.Pathetic)\
**Post date:** [June 1, 2019, 4:42am UTC](https://forums.unrealengine.com/t/linker-error-when-adding-variable-to-character-class/449833/5 "2019-06-01T04:42:49Z")

</div>

I realized that the problem was when trying to import the 3rd Person Character Template. I just deleted the 3rd person C++ files from the source folder, since I only needed the mannequin. It worked, though I’m not sure why it happened.

I apologize for not adding the screenshot, I did not take one before I found how to fix it. I should’ve elaborated the question more, but it’s my first question here.
