Deploying a flat catalog for Qt 5 applications?

I am deploying a Qt 5 application compiled for windows. It turns out that some functions are stored in plugins, which are DLLs that need to be placed in a specific subdirectory, forcing me to use this structure:

  applicaton directory
          |
          + ------- platforms
          |  |
          + + -------- qwindows.dll
          |
          + ------- qpldrivers
          |  |
          |  + -------- qsqlite.dll
          | 
          + ------- myprogram.exe, QtCore5.dll, etc.

I would like to collapse 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 any way to do this?

+6
source share
2 answers

Try using addLibraryPath :

 QCoreApplication::addLibraryPath("."); QCoreApplication::addLibraryPath("otherLibDir"); 
+1
source

You can write a qt.conf file for configuration if Qt is looking for plugins.

http://doc.qt.io/qt-5/qt-conf.html

+1
source

Source: https://habr.com/ru/post/977071/


All Articles