Path to dependent dlls in plugin

Hello everyone!

I have a plugin that uses a dll. That dll is dependent of other dlls. Unreal looks for those additional dlls only in Binaries folder of plugin or project on Editor launch and only in Binaries folder of packaged game ignoring the plugins folder. How to change that? How can I add more search paths for additional dll files?

Delay-loaded DLLs can be specified from a build.cs file using a declaration like this: 

PublicDelayLoadDLLs.Add("foo.dll")
or
PublicIncludePaths.Add()

Perhaps you can add it with the PublicDelayLoadDLLs path array (it might take relevant paths)

This thread also tackles your problem

1 Like

I am using PublicDelayLoadDLLs.Add together with RuntimeDependencies.Add. It works fine, but if I use other path than Binaries folder it won’t work for additional dlls. For example, I have Main.dll. To load it to memory it needs to load additional.dll. I can place Main.dll anywhere and it will be found without issues. But in order to load it, Unreal will search for additional.dll only in Binaries folder, even if I use RuntimeDependencies.Add and it is packaged in another folder.

I have found a solution by using FPlatformProcess::AddDllDirectory(*DllsPath) in plugin cpp file.

2 Likes