# Error LINK2019: unresolved external symbol when packaging, not when compiling

**URL:** <https://forums.unrealengine.com/t/error-link2019-unresolved-external-symbol-when-packaging-not-when-compiling/409371>\
**Category:** Platform & Builds\
**Tags:** lnk2019, engine-compile, linker-error, unreal-engine, pointer, packaging-projects, question\
**Created:** [November 11, 2017, 10:29pm UTC](https://forums.unrealengine.com/t/error-link2019-unresolved-external-symbol-when-packaging-not-when-compiling/409371 "2017-11-11T22:29:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_3cc02384](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3cc02384](https://forums.unrealengine.com/u/anonymous_user_3cc02384)\
**Post date:** [November 11, 2017, 10:29pm UTC](https://forums.unrealengine.com/t/error-link2019-unresolved-external-symbol-when-packaging-not-when-compiling/409371/1 "2017-11-11T22:29:59Z")

</div>

Greetings, I’m not sure why I’m getting these errors when building. The game code compiles correctly and runs good in editor, but when I try packaging, I get these error messages:

```
VRPawn.cpp.obj : error LNK2019: unresolved external symbol "public: short * __cdecl AVRPlayerController::GetFingerData(void)" (?GetFingerData@AVRPlayerController@@QEAAPEAFXZ) referenced in function "public: virtual void__cdecl AVRPawn::Tick(float)" (?Tick@AVRPawn@@UEAAXM@Z)
VRPawn.cpp.obj : error LNK2019: unresolved external symbol "public: float * __cdecl AVRPlayerController::GetGyroData(void)" (?GetGyroData@AVRPlayerController@@QEAAPEAMXZ) referenced in function "public: virtual void__cdecl AVRPawn::Tick(float)" (?Tick@AVRPawn@@UEAAXM@Z)
error LNK2019: unresolved external symbol "public: class FSerialPortHandler * __cdecl AVRPlayerController::GetSerialPort(void)" (?GetSerialPort@AVRPlayerController@@QEAAPEAVFSerialPortHandler@@XZ) referenced in function "public: virtual void__cdecl AVRPawn::Tick(float)" (?Tick@AVRPawn@@UEAAXM@Z)

```

In the Pawn class I’m trying to get a pointer to an array from the Controller class

```
//Controller class functions to get data
int16_t* AVRPlayerController::GetFingerData()
{
	return this->FingerData;
}
float* AVRPlayerController::GetGyroData()
{
	return this->GyroData;
}
// Return pointer to FSerialPortHandler object
FSerialPortHandler* AVRPlayerController::GetSerialPort()
{
	return Teensy;
}

```

Then again trying to get the data in the Pawn class

```
ThisController = Cast<AVRPlayerController>(GetController());
FingerData = ThisController->GetFingerData();
GyroData = ThisController->GetGyroData();

```

where all variables are of the required type. As stated above, everything compiles and runs correctly. I would appreciate if somebody could help me, why the game won’t build.

---

<div class="post-metadata">

**Author:** ![Unzkilled](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unzkilled](https://forums.unrealengine.com/u/Unzkilled)\
**Post date:** [November 12, 2017, 9:38pm UTC](https://forums.unrealengine.com/t/error-link2019-unresolved-external-symbol-when-packaging-not-when-compiling/409371/2 "2017-11-12T21:38:46Z")

</div>

Try renaming the binaries folder, forcing the compiler to generate all files new

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3cc02384](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3cc02384](https://forums.unrealengine.com/u/anonymous_user_3cc02384)\
**Post date:** [November 12, 2017, 10:08pm UTC](https://forums.unrealengine.com/t/error-link2019-unresolved-external-symbol-when-packaging-not-when-compiling/409371/3 "2017-11-12T22:08:25Z")

</div>

Tried it now, but I’m still getting the same error.

---

<div class="post-metadata">

**Author:** ![Unzkilled](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unzkilled](https://forums.unrealengine.com/u/Unzkilled)\
**Post date:** [November 13, 2017, 9:05am UTC](https://forums.unrealengine.com/t/error-link2019-unresolved-external-symbol-when-packaging-not-when-compiling/409371/4 "2017-11-13T09:05:47Z")

</div>

Can you try the same with the Intermediate folder?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3cc02384](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3cc02384](https://forums.unrealengine.com/u/anonymous_user_3cc02384)\
**Post date:** [November 13, 2017, 10:42am UTC](https://forums.unrealengine.com/t/error-link2019-unresolved-external-symbol-when-packaging-not-when-compiling/409371/5 "2017-11-13T10:42:38Z")

</div>

I’m still getting the same error.
