0

I have a plugin application (.DLL) that links dynamically to multiple other QT DLLs. When the plugin is loaded in the third party software, it fails to find the dependencies which are located exactly in the same folder as the plugin DLL. The structure looks like this:

myplugin.dll
platforms\
    qwindowsd.dll
QtQml\
    qmlplugind.dll
...

The executable of the software that loads the Plugin is installed under C:/Program Files/MySoftware/Application.exe

Weirdly enough, when I copy the contents of my packaged plugin (dlls and its dependencies) directly into the software's executable directory, next to the executable, it works like a charm, and the plugin is able to find all its DLLs in that directory. So my guess is the DLL lookup isn’t appropriate?

This might relate to this: Search path for a DLL referenced by a plug-in DLL but the solution to load every QT dll explicitly seems wrong.

Any help on that matter would be appreciated. Thanks

EDIT: I tried to put the path to where the DLLs are explicitly in the PATH variable without success.

blondbeer
  • 45
  • 4
  • You may try to use [this document](https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order) for reference. – tromgy Apr 14 '22 at 18:43
  • For my Qt applications, I have a bin folder that contains the Qt dlls and my executable + all required third party dlls. Also inside that bin folder I have a platforms folder containing the Qt windows platform dll, I have a sqldrivers folder and finally a plugins folder containing any Qt plugins I will load from QPluginLoader. With this setup I don't need to alter the PATH environment variable. I have used this approach since Qt4.6 or 4.8 – drescherjm Apr 14 '22 at 19:06

0 Answers0