Loading Libraries(.dll) While Launching Unreal Engine

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?

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.

3 Likes

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

1 Like