# Win64 Package encounter's fatal error on start due to missing third party dll otherwise present in PIE

**URL:** <https://forums.unrealengine.com/t/win64-package-encounters-fatal-error-on-start-due-to-missing-third-party-dll-otherwise-present-in-pie/2139540>\
**Category:** Programming & Scripting\
**Tags:** c-c, windows, c-class-wizard, c-and-bluepri, c-custommeshcomponen, c-and-blueprint, c-error, c-class, c-custom-shape, c-programming, c-cone-shape, unreal-engine, crash, Packaging, editor, packaging-projects, CPP, question\
**Created:** [November 21, 2024, 2:02am UTC](https://forums.unrealengine.com/t/win64-package-encounters-fatal-error-on-start-due-to-missing-third-party-dll-otherwise-present-in-pie/2139540 "2024-11-21T02:02:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![MotiveNick](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MotiveNick](https://forums.unrealengine.com/u/MotiveNick)\
**Post date:** [November 21, 2024, 7:42am UTC](https://forums.unrealengine.com/t/win64-package-encounters-fatal-error-on-start-due-to-missing-third-party-dll-otherwise-present-in-pie/2139540/2 "2024-11-21T07:42:06Z")

</div>

# Solution!

I’ve resolved the fatal error on .exe startup! The problem came down to the dll’s needed to be beside the .exe (also running the .exe generated at `{project_name}\Binaries\Win64`, not the other one) and so within `{ProjectCoreLibrary}.Build.cs` I needed to change the section:

```auto
PublicDelayLoadDLLs.Add("{projectcore}.dll");
RuntimeDependencies.Add(Path.Combine(binFolder, "{projectcore}.dll")); // My third party DLL

```

to

```auto
PublicDelayLoadDLLs.Add("{projectcore}.dll");
RuntimeDependencies.Add(
    Path.Combine("$(BinaryOutputDir)", "{projectcore}.dll"),
    Path.Combine(binFolder, "{projectcore}.dll")
);

```

And including a `RuntimeDependencies.Add(destination, source);` for all the dll’s beside my `{projectcore}.dll` from the thirdparty build.

I initially had file lock issues that prevented the `RuntimeDependencies.Add(destination, source);` from packaging but those decided to arbitrarily disappear and I could package Win64 lol.

I can’t say with this in mind I understand how the PIE even works, somehow the editor just knows where the DLL’s are more loosely. While the packaged versions need to be more explicit.

# Sources that helped

[What helped was re-reading this blog post on third party dll’s](https://georgy.dev/posts/third-party-integration/).

[And finding this forum post on the similar issue](https://forums.unrealengine.com/t/specify-dll-location-using-plugin-in-cooked-project/436693/2).

Hope these help anyone else!

---

_[View the full topic](https://forums.unrealengine.com/t/win64-package-encounters-fatal-error-on-start-due-to-missing-third-party-dll-otherwise-present-in-pie/2139540)._
