# Loading Libraries(.dll) While Launching Unreal Engine

**URL:** <https://forums.unrealengine.com/t/loading-libraries-dll-while-launching-unreal-engine/471906>\
**Category:** Plugins\
**Tags:** dll, third-party-librarie, unreal-engine, Plugins, CPP, question\
**Created:** [September 25, 2020, 7:13am UTC](https://forums.unrealengine.com/t/loading-libraries-dll-while-launching-unreal-engine/471906 "2020-09-25T07:13:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CtnDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ctndev/32/1133321_2.png) [@CtnDev](https://forums.unrealengine.com/u/CtnDev)\
**Post date:** [September 25, 2020, 7:13am UTC](https://forums.unrealengine.com/t/loading-libraries-dll-while-launching-unreal-engine/471906/1 "2020-09-25T07:13:10Z")

</div>

Hi Dear Community,   
  
Currently I have my own third party library plugin.   
  
I have managed to load dll’s from place on .cpp, It runs perfectly when I load my game.   
  
_my dll’s are also under third party folder in plugin_, but while launching unreal engine I got following error.   
   
  
**because the file couldn’t be loaded by the OS.**   
   
  
It searches dlls from some generic location.  
  
Couple questions :

1. I know I need to do it in UBT. But how!  
2. Does UBT related loadings are loaded when I’m launching unrel engine?

---

<div class="post-metadata">

**Author:** ![CtnDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ctndev/32/1133321_2.png) [@CtnDev](https://forums.unrealengine.com/u/CtnDev)\
**Post date:** [September 25, 2020, 8:42am UTC](https://forums.unrealengine.com/t/loading-libraries-dll-while-launching-unreal-engine/471906/2 "2020-09-25T08:42:30Z")

</div>

why I never get respond any of my question in this site.!

---

<div class="post-metadata">

**Author:** ![CtnDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ctndev/32/1133321_2.png) [@CtnDev](https://forums.unrealengine.com/u/CtnDev)\
**Post date:** [September 25, 2020, 9:03am UTC](https://forums.unrealengine.com/t/loading-libraries-dll-while-launching-unreal-engine/471906/3 "2020-09-25T09:03:36Z")

</div>

Yet again answering my own question. My brain overflow since we dont have any good guides related to it.  
  
I added : `PublicDelayLoadDlls` to my main build.cs file. But this function doesnt get any of path so I just regularly put dll name inside of this function. Steps that I have

1. Dynamically load library implementation in plugin .cpp with GetDllHandles
2. Then inserted PublicDelayLoadDlls to build.cs

I really wonder execution order of this plugin. I hope this answer lets you somewhere, if I learn more I will share here.

* * *

**Edit**   
  
I solved out why worked after I add PublicDelayLoadDlls, UBT tries to load all dll’s required by headers and includes required, when you use `GetDllHandles` actually you are loading dll. `PublicDelayLoadDlls` lets you prioritize cpp startup module operations before loading dll.   
  
I hope this helps.
