# Linker Errors LNK2001 & LNK2019 when packaging the project

**URL:** <https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877>\
**Category:** C++\
**Tags:** error, lnk2019, Packaging-Error, unreal-engine, CPP, question\
**Created:** [February 7, 2019, 4:32am UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877 "2019-02-07T04:32:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil\_04](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nikhil\_04](https://forums.unrealengine.com/u/Nikhil_04)\
**Post date:** [February 7, 2019, 4:32am UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/1 "2019-02-07T04:32:00Z")

</div>

Hi,

I have just finished the development of my game and want to package it for the windows (64-bit). However, when I try to run the packaging process, it fails with linker errors unresolved symbols. But, the weird thing is that the game is compiling and running fine in the editor.

I have included the packaging logs below. Has anyone experienced this before? Any help will be appreciated.

link text

---

<div class="post-metadata">

**Author:** ![SenseiHaketon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SenseiHaketon](https://forums.unrealengine.com/u/SenseiHaketon)\
**Post date:** [February 7, 2019, 12:45pm UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/2 "2019-02-07T12:45:40Z")

</div>

I think this means, that you have a function in your header file that doesn’t exist in your cpp file.

---

<div class="post-metadata">

**Author:** ![Nikhil\_04](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nikhil\_04](https://forums.unrealengine.com/u/Nikhil_04)\
**Post date:** [February 7, 2019, 1:09pm UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/3 "2019-02-07T13:09:08Z")

</div>

But, I’m able to build the project in Editor. If the function definition was missing, it would have raised the same error then and there…

---

<div class="post-metadata">

**Author:** ![SenseiHaketon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SenseiHaketon](https://forums.unrealengine.com/u/SenseiHaketon)\
**Post date:** [February 7, 2019, 1:13pm UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/4 "2019-02-07T13:13:56Z")

</div>

Then show me your code for the functions the error is occuring. .h and .cpp 🙂

---

<div class="post-metadata">

**Author:** ![Nikhil\_04](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nikhil\_04](https://forums.unrealengine.com/u/Nikhil_04)\
**Post date:** [February 7, 2019, 7:14pm UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/5 "2019-02-07T19:14:08Z")

</div>

Thank you for your time and effort, but I’ve figured out what was I doing wrong.

So, what was happening was that the methods for which I was getting the linker errors, were declared as ‘inline’ but due to some reason I defined them in the .cpp file. Because of that the linker was not able to find the function definitions for those function while packaging.

This brings another doubt. Why didn’t the linker raise that error when compiling in the editor? Does this mean that the linker’s functioning is somehow different for both the operations?? Or is it a Bug?

---

<div class="post-metadata">

**Author:** ![tommybazar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tommybazar](https://forums.unrealengine.com/u/tommybazar)\
**Post date:** [November 11, 2020, 6:08am UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/6 "2020-11-11T06:08:50Z")

</div>

I had the same error caused by inconsitently placed `#if WITH_EDITOR` and `#endif` between header and source files. Maybe it will help somebody 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3be3ce93](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3be3ce93](https://forums.unrealengine.com/u/anonymous_user_3be3ce93)\
**Post date:** [August 9, 2021, 10:20pm UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/7 "2021-08-09T22:20:39Z")

</div>

Hello, I’m having same problem on my project. Editor works fine but Everytime I try to package my project, LNK2019 & LNK2001 errors come out.  
Can you describe your solution with more details?  
Did you moved your function body to .h file?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3be3ce93](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3be3ce93](https://forums.unrealengine.com/u/anonymous_user_3be3ce93)\
**Post date:** [August 9, 2021, 10:20pm UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/8 "2021-08-09T22:20:43Z")

</div>

I had same problem and here is my solution. (the way I fixed my errors)  
I had same LNK2001 & LNK 2019 errors and I found this video()  
I tried to rebuild, clean the whole solution but it didn’t work.

but REMOVE INTERMEDIATE FOLDER (specifically, i just removed Intermediate\>Build\>Win64\>{My Proejct Name} Folder) fixed my errors.

So, If you are having similar/same issues, try removing that folder.  
Cheers

---

<div class="post-metadata">

**Author:** ![Nikhil\_04](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nikhil\_04](https://forums.unrealengine.com/u/Nikhil_04)\
**Post date:** [August 10, 2021, 5:53pm UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/9 "2021-08-10T17:53:03Z")

</div>

Hello  
Yes, you are correct. I moved the function body to .h file  
Since they were inline functions, the linker was expecting them to be defined in the .h file itself…

---

<div class="post-metadata">

**Author:** ![ThalesMML](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThalesMML](https://forums.unrealengine.com/u/ThalesMML)\
**Post date:** [September 13, 2022, 2:07pm UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/10 "2022-09-13T14:07:15Z")

</div>

I finally fixed the same error thanks to you.

---

<div class="post-metadata">

**Author:** ![jacksonnexhip](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacksonnexhip/32/494650_2.png) [@jacksonnexhip](https://forums.unrealengine.com/u/jacksonnexhip)\
**Post date:** [August 22, 2023, 5:31am UTC](https://forums.unrealengine.com/t/linker-errors-lnk2001-lnk2019-when-packaging-the-project/442877/11 "2023-08-22T05:31:31Z")

</div>

I don’t know anything about or use C++ but I am getting this error after updating my project from UE4.27 to 5.2

Any idea what I can do to fix this?

My output log: [LogUObjectHash: Compacting FUObjectHashTables data took 0.59msLogTurnkeySupp - Pastebin.com](https://pastebin.com/c7Q0BFJ7)

Could this have something to do with it?

LogLauncherProfile: Unable to use promoted target - …/…/…/…/…/…/Users/Jackson/Documents/Unreal Projects/RRM4 5.2/Binaries/Win64/RRM4-Win64-Shipping.target does not exist.

Edit: Got it working: [Unknown Package Error UE5.2](https://forums.unrealengine.com/t/unknown-package-error-ue5-2/1268418)
