Evgenii Legotckoi
Evgenii LegotckoiMarch 7, 2016, 10: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

Video

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.

Do you like it? Share on social networks!

alex_lip
  • Nov. 19, 2018, 7:32 a.m.

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


For windeployqt there is the option --qmldir .

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


Evgenii Legotckoi
  • Nov. 19, 2018, 12:53 p.m.

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

А
  • July 9, 2022, 12:32 p.m.
  • (edited)

Тук-тук. Привет из прошлого! Не могли бы вы подробнее расказать о том, куда должна быть записана данная вставка "windeployqt --qmldir f:\myApp\sources f:\build-myApp\myApp.exe"? Я пробовал указать после пути распаковки .dll, но получаю ошибку.

C:\Qt\Qt5.14.2\5.14.2\mingw73_64\bin>windeployqt.exe c:\p\untitled.exe windeployqt --qmldir ...

f:\build-myApp\myApp.exe - это путь к .exe файлку, который я хочу открыть, я так понимаю, а первый что означает (f:\myApp\sources)? Это папка с релизом проекта или это папка с самим проектом (там где .pro-файл)? Заранее спасибо

Comments

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

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:50points,
  • Rating points-4
m

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:80points,
  • Rating points4
m

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:20points,
  • Rating points-10
Last comments
Evgenii Legotckoi
Evgenii LegotckoiNov. 1, 2024, 12:37 a.m.
Django - Lesson 064. How to write a Python Markdown extension Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup
A
ALO1ZEOct. 19, 2024, 6:19 p.m.
Fb3 file reader on Qt Creator Подскажите как это запустить? Я не шарю в программировании и кодинге. Скачал и установаил Qt, но куча ошибок выдается и не запустить. А очень надо fb3 переконвертировать в html
ИМ
Игорь МаксимовOct. 5, 2024, 5:51 p.m.
Django - Lesson 064. How to write a Python Markdown extension Приветствую Евгений! У меня вопрос. Можно ли вставлять свои классы в разметку редактора markdown? Допустим имея стандартную разметку: <ul> <li></li> <li></l…
d
dblas5July 5, 2024, 9:02 p.m.
QML - Lesson 016. SQLite database and the working with it in QML Qt Здравствуйте, возникает такая проблема (я новичок): ApplicationWindow неизвестный элемент. (М300) для TextField и Button аналогично. Могу предположить, что из-за более новой верси…
k
kmssrFeb. 9, 2024, 5:43 a.m.
Qt Linux - Lesson 001. Autorun Qt application under Linux как сделать автозапуск для флэтпака, который не даёт создавать файлы в ~/.config - вот это вопрос ))
Now discuss on the forum
Evgenii Legotckoi
Evgenii LegotckoiJune 25, 2024, 1:11 a.m.
добавить qlineseries в функции Я тут. Работы оень много. Отправил его в бан.
t
tonypeachey1Nov. 15, 2024, 5:04 p.m.
google domain [url=https://google.com/]domain[/url] domain [http://www.example.com link title]
NSProject
NSProjectJune 4, 2022, 1:49 p.m.
Всё ещё разбираюсь с кешем. В следствии прочтения данной статьи. Я принял для себя решение сделать кеширование свойств менеджера модели LikeDislike. И так как установка evileg_core для меня не была возможна, ибо он писался…
9
9AnonimOct. 25, 2024, 7:10 p.m.
Машина тьюринга // Начальное состояние 0 0, ,<,1 // Переход в состояние 1 при пустом символе 0,0,>,0 // Остаемся в состоянии 0, двигаясь вправо при встрече 0 0,1,>…

Follow us in social networks