Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Deploying a Qt 5 Gui application on Windows

$
0
0
After reading the official Qt 5 Windows application deployment guidelines [qt-project.org], and after testing, I’ve come up with the following questions when deploying a Qt 5 Gui application: 1) The guidelines say that the QT5_INSTALL_DIR_PATH/plugins/platforms/qwindows.dll should be copied in a subdirectory named “platforms” which should be created at the same directory level as the application’s executable: App.exe platforms/qwindows.dll Let’s start clean. Consider an application that depends on the core, gui and widgets Qt modules. After building a debug version of the application I’ve started it from Windows Explorer. I was given an error message several times complaining about missing dlls. I’ve copied them all: Qt5Cored.dll Qt5Guid.dll Qt5Widgetsd.dll icudt49d.dll icuin49d.dll icuuc49d.dll libGLESv2d.dll D3DCompiler_43.dll After copying only these, depending on the compiler used to build the application: MSVC or GCC, you will get the following errors when trying to start the application: GCC: unknown error (its description doesn’t say anything informative about the source of the problem) MSVC: Failed to load platform plugin “windows”. Available platforms are: minimal windows Let’s consider the MSVC case. If you copy the whole “platforms” directory from the Qt 5 plugins directory and paste it in the application executable’s directory, you will get the same error but with somehow “doubled” output: MSVC: Failed to load platform plugin “windows”. Available platforms are: minimal windows minimal windows Now, running Dependency Walker on the qwindowsd.dll, what becomes obvious is that it depends on libEGLd.dll. After copying it to the application’s folder the application is run without runtime errors. Now remove the “platforms” directory from the application’s directory. The application is again ran without runtime errors. So, my first question is: 1) When it is mandatory to deploy the platform plugins along with our application’s executable in a “platforms” subdirectory? 2) Is the minimal platform plugin required only by GCC ( part of MinGW – minimalist )? And a more general question: 1) How to decide which plugins to deploy depending on the selected Qt modules to link against? For now, I know I have to deploy the sqldrivers plugin if QT += sql. The officia Qt 5 Windows application deployment guidelines say that: If you are deploying an application that uses QtWebKit to display HTML pages from the World Wide Web, you should include all text codec plugins to support as many HTML encodings possible. I don’t see any textcodec plugins in the “plugins” directory of the Qt 5 installation. So, since the plugins are dynamically loaded and Dependency Walker cannot resolve such dependencies (it has an option but it is said to work in some scenarios), then what is the deployment policy of the Qt 5 plugins e.g. when an application/dynamic library links agains a given Qt module, which corresponding plugins should be deployed as well?

Viewing all articles
Browse latest Browse all 18427

Trending Articles