Evgenij LegotskojMarch 7, 2016, 9:52 a.m.

Qt WinAPI - Lesson 003. How to use windeployqt for collect all DLL?

In one of the lessons of the Qt it has already been shown how to collect all the DLL, used in the project for the training program for use on other PCs running Microsoft Windows, and now propose to get acquainted with the utility that comes with Qt. This utility is called windeployqt and is a console application, which usually comes bundled with compiler MinGW or MSVC .

To use windeployqt must run from the console, passing as an argument the path to the compiled executable file. Then windeployqt gather all the necessary libraries in the folder where the executable file is located.

The windeployqt utility located in the bin folder, which in turn is located in the folder of the compiler for Qt. Thus, the path to the folder can be as follows:

  • MinGW - C:\QT\5.5\mingw492_32\bin\windeployqt.exe
  • MSVC - C:\QT\5.5\msvc2013\bin\windeployqt.exe

Work with windeployqt

Now get to work with windeployqt . Let's say you already have a compiled executable file and you need to collect all the required DLL for his work. To do this, we'll do a little preparation and perekinem executable file in the folder prepared for collection. I use to demonstrate EColor project, which is written using MinGW . The executable project file will be placed in the following path D:\EColor\EColor.exe.

After that, it will be necessary to open the console (cmd), and go to the console in a folder with windeployqt . Then run the utility by passing its path or file location, as shown in the following figure.

Then the utility will collect all the necessary work for the executable file DLL. And it will look as follows.

Possible mistakes

Also worth noting is that not everything can go smoothly. For example, windeployqt, can not find the library gcc compiler and give the following error:

Cannot find GCC installation directory. g++.exe must be in the system path.

It is fixed with the prescription in the path environment variable to the bin folder, which contains the GCC and the appropriate library.

To do this, go to the following direction (example for OS Windows 7 ):

Control Panel / System / Advanced System Settings / Environment Variables

Then add in the PATH system variables, which are prescribed path to GCC and its libraries. In my case it looks like this:

  • Variable name: PATH
  • Variable value: D:\AndroidQT\QT\5.5\mingw492_32\bin;D:\AndroidQT\QT\Tools\mingw492_32\bin;%PATH%

Then I recommend to restart the PC. After that, the error must be an abyss, and the corresponding library will have to catch up in the folder with the executable file.

The files that can not be collected windeployqt

Also, some files can not be collected via windeployqt , that should also take into account and test the application on another PC before release.

For example, during collecting DLL for EColor, windeployqt still missed the following files:

  • LIBEAY32.dll
  • MSVCP90.dll
  • MSVCR90.dll
  • MSVCR120.dll
  • ssleay32.dll

If the project using QML

UPD 19.11.2018 by alex_lip :

If the project uses QML, then you need to add a special directive --qmldir

This directive will have to specify where to get the source of QML.

windeployqt --qmldir f:\myApp\sources f:\build-myApp\myApp.exe


We recommend hosting TIMEWEB
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.
Support the author Donate

Добавьте в статью, что если используется Qml следует делать так -

For windeployqt there is the option --qmldir .

windeployqt --qmldir f:\myApp\sources f:\build-myApp\myApp.exe

Спасибо, добавил


Only authorized users can post comments.
Please, Log in or Sign up

Did the EVILEG help you? Support the development of the site!

How to become an author?

Contribute to the evolution of the EVILEG community.

Learn how to become a site author.

Learn it

Let me recommend you the excellent hosting on which EVILEG is located.

For many years, Timeweb has been proving his stability.

For projects on Django I recommend VDS hosting

View Hosting

C++ - Test 001. The first program and data types

  • Result:80points,
  • Rating points4

Qt - Test 001. Signals and slots

  • Result:78points,
  • Rating points2
  • Sergej
  • July 10, 2020, 2:15 p.m.

Qt - Test 001. Signals and slots

  • Result:68points,
  • Rating points-1
Last comments

Qt/C++ - Lesson 023. Moving QGraphicsItem on QGraphicsScene with mouse help

Пережиток plain C, ограничение видимости. По идее можно и .c, .cpp файлы подключать через директиву include. Для компилятора разницы особой нет, какое расширение будет.

Qt/C++ - Lesson 023. Moving QGraphicsItem on QGraphicsScene with mouse help

Подскажите, пожалуйста, почему функция рандома определена только в спп файле и объявлена при этом статической?

Django - Tutorial 027. Implementation Google reCAPTCHA

Спасибо. Только использую декоратор не в urls.py а перед views

Qt WinAPI - Lesson 001. How to collect all DLL, which used in Qt project?

Вы меня не совсем правильно поняли, но все равно спасибо, принял все к сведению. Все сделал как вы сказали, все отлично работает, еще раз огромнейшее спасибо) Разве что только что были опять про…

Qt WinAPI - Lesson 001. How to collect all DLL, which used in Qt project?

Стоило перед использованием что ли инструкцию прочитать https://www.cyberforum.ru/blogs/131347/blog2457.html "После сборки при запуске требовались dll," Ясное дело стоило задепло…
Now discuss on the forum

Qt IOs магнитное поле

Всем привет! Пытаюсь получить данные магнитного поля, используя класс QMagnetometer. Все получается, если задать параметр returnGeoValues false (как по-умолчанию). При этом выдаются ra…

Drug Drop problems


Как в Qt в qmenu добавить scrollarea

Вот это наследованный класс меню. Но посути это обычное меню. #pragma once#include <QtWidgets>class TransMenu : public QMenu { Q_OBJECTpublic: TransMenu(QWidget* parent = …

Нужен человек кто хорошо понимает паттерны и их использование

Добрый день. Если вопрос про паттерны, то рисуй диаграмму классов.

Сборка Qt / C++ проекта под windows и linux

Отбой. Забыл в исходнике обернуть каждый #include макросом. #ifdef Q_OS_WIN32#include "win_controller.h"#else#include "linux_controller.h"#endif
© EVILEG 2015-2020
Recommend hosting TIMEWEB