I'm deploying a Qt 5 application, compiled to windows. It turns out that some functionality is stored in plugins that are DLLs that have to be placed in a specific sub-directory, forcing me to use this structure:
applicaton directory | +------- platforms | | + +-------- qwindows.dll | +------- qpldrivers | | | +-------- qsqlite.dll | +------- myprogram.exe, QtCore5.dll, etc.
I would like to flatten this directory so that qwindows.dll and qsqlite.dll (and any other future plugins) are stored in the same directory as my executable.
applicaton directory | +------- myprogram.exe, QtCore5.dll, qwindows.dll, qsqlite.dll, etc.
Is there a way to do this?
To deploy the application, we must make sure that we copy the relevant Qt DLLs (corresponding to the Qt modules used in the application) and the Windows platform plugin, qwindows. dll , as well as the executable to the same directory tree in the release subdirectory.
You can write a qt.conf
file to customize were Qt looks for plugins.
http://doc.qt.io/qt-5/qt-conf.html
Try to use addLibraryPath
:
QCoreApplication::addLibraryPath(".");
QCoreApplication::addLibraryPath("otherLibDir");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With