-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.10.0
-
None
Scenario:
QT is used in c:\foo\a.dll that uses Qt Multimedia. c:\bar\test.exe loads the dll. A sample repro skeleton is available at https://github.com/lwahonen/qt-dll
After running windeployqt c:\foo\a.dll, Qt6Multimedia.dll is deployed to c:\foo and the backend is placed in c:\foo\multimedia\ffmpegmediaplugin.dll
Unfortunately loading ffmpegmediaplugin.dll fails because it's dependent on Qt6Multimedia.dll which is not found in neither the executable directory ( c:\bar ) nor in the same directory as backend itself ( c:\foo\multimedia )
This can be worked around by adding c:\foo to dll search path with SetDllDirectory:
QString currentDir = QString::fromStdWString(getCurrentDllFolder()); <- returns c:\foo
app.addLibraryPath(currentDir);
SetDllDirectory(getCurrentDllFolder().c_str());