Qt provides a deployment tool for Windows:
windeployqt. The tool inspects a Qt application executable for its dependecies to Qt modules and creates a deployment directory with the necessary Qt files to run the inspected executable. A possible script may look like:
set PATH=%PATH%;<qt_install_prefix>/bin windeployqt --dir /path/to/deployment/dir /path/to/qt/application.exe
set command is called to add Qt’s
bin directory to the
PATH environment variable.
windeployqt is then called:
- The path to the deployment directory is given an optional argument given with the parameter
--dir(default is the path where
- The path to the executable to be inspected is given as last argument.
The deployment directory can then be bundled with the executable.
If you are using pre-compiled Qt5.7.0 with vs2013 on Windows (not sure if all versions has this issue), there is a chance, that you need to manually copy
<QTDIR>\5.7\msvc2015\qml to your bin directory of your program. Otherwise the program will auto quit after start.
See also Qt documentation.