Solved Dependency Walker shows some Qt dll's during profiling, should they be deployed?
-
I ran my application with profiling in dependency walker and it showed the following libraries as required by Qt5Core.dll. (My application is dynamically linked to Qt).
\plugins\imageformats\qgif.dll
\plugins\imageformats\qico.dll
\plugins\imageformats\qjpeg.dll
\plugins\bearer\qgenericbearer.dll
\plugins\bearer\qnativewifibearer.dll
\plugins\accessible\qtaccessiblewidgets.dll
wlanapi.dll.dll [yellow icon with ?, meaning dll not found]Now I can understand if qjpeg.dll is required, as I am opening JPEG images.
qico.dll is probably required because I am using the Windows .ico file while building to add meta data like product version, product name, etc.But I do not understand why the remaining plugins are required?
I have already deployed the Qt5Network.dll because I am using the QNetworkAccessManager::get (and post), for communicating with a server API to download/upload JSON files.What is interesting is that if I rename the Qt install folder so that the Qt SDK is not in the PATH, dependency walker is no longer showing these plugins even though the application is working just the same.
So, can someone please tell me exactly what is going on, and which of these plugins I need to deploy?
Thank you. -
Hi,
Both bearer plugins are there for the network module.
The dlls coming from Windows should not be deployed with your application.
-
@SGaist
Thank you for your reply!-
So I should distribute all the above dll's except wlanapi.dll.dll.
I was actually not aware that I should distribute the bearer plugins.
Is there a Qt tool which determines which Qt libraries I need to deploy?
Just so that I don't repeat the same mistake again. -
My application is not able to load the jpeg images on non Qt SDK computers as expected. But how is it then it is able to communicate with the server without the bearer plugins?
-
-
You can use windeployqt for that, it should also add all plugins for the modules you are using. You might get more than what you use (e.g. the image formats plugin) since it can't guess what you are using exactly in your application.
IIRC, they are used for network session handling.
-
@CAD_coding said:
- So I should distribute all the above dll's except wlanapi.dll.dll.
I was actually not aware that I should distribute the bearer plugins.
Not quite. See below.
Is there a Qt tool which determines which Qt libraries I need to deploy?
Qt and your application do not "know" exactly which plugins you need. This is their "thought process":
"Hmm... This application uses QImage, so let me search for image format plugins... OK I've found the GIF, ICO and JPEG plugins. I'm not sure what formats will be used, so I'll just load them all, to make sure I support all possibilities.
There is no tool that can determine which plugins you need. Imagine this: You create an application lets the user to select an image file to display on screen. The deployment tool can't know what formats the user will select, so it cannot make decisions like "this application needs to support JPEG but not GIF". You, the developer, need to make that decision.
If you don't want to support GIF images, don't deploy qgif.dll.
Just so that I don't repeat the same mistake again.
- My application is not able to load the jpeg images on non Qt SDK computers as expected. But how is it then it is able to communicate with the server without the bearer plugins?
The bearer plugins are for dynamically managing network interfaces. See http://doc.qt.io/qt-5/bearer-management.html
You do not need the bearer plugin to call
QNetworkAccessManager::get()
andQNetworkAccessManager::post()
. You only need to make sure that your computer is online.Finally, do you want to provide any accessibility features? (http://doc.qt.io/qt-5/accessible.html ) If not, you don't need to deploy qtaccessiblewidgets.dll
- So I should distribute all the above dll's except wlanapi.dll.dll.
-
@JKSH
Thank you very much for that eye opener!
I understand now, what mistake I was doing with the image plugins.
Certainly I do not need the bearer and accessibility plugins.
I am opening JPEG files, so I will deploy that dll.
Regarding ICO, I want to know whether I should deploy it or not?
I am not supporting .ico files in my application, but it is however used during compile time for creating my application's icon logo (The image you see in Explorer when you select an exe).
So is there a need to deploy the ICO plugin? -
You're welcome :)
@CAD_coding said:
Regarding ICO, I want to know whether I should deploy it or not?
I am not supporting .ico files in my application, but it is however used during compile time for creating my application's icon logo (The image you see in Explorer when you select an exe).
So is there a need to deploy the ICO plugin?No, because the icon is compiled into your .exe file, and Windows can read the icon data without Qt.
The image format plugins are for loading images at run-time (while the program is running).
-
@JKSH
Thank you for your clarifications, it helped me a lot!I am just asking this out of curiosity as this bug/behaviour has caused a great deal of embarrassment for me.
When running on non Qt SDK PC's my application is unable to load JPEG images.
However on my PC when I rename the Qt SDK so that it is unable to get the plugins from the SDK, it is still able to load the images...
How is this possible? These plugins were not loaded from anywhere as I checked with profiling on dependency walker.[Embarrassing because I publicly posted on my Facebook that I had released a software that recommends movies, and when 200 odd people download it, half of them reported a crash to me {I had deleted a class variable pointer and was accessing it, strangely it was working on my PC, but crashed as expected on some PC's; should have crashed on mine too, but I don't know why it didn't}, some said images were not getting shown in the application{As JPEG plugin wasn't deployed it didn't show images on other PC's, but why was it showing on mine I don't know}. Google added salt to the wound by showing my setup exe for the next release (created with NSIS) stored on Drive as a virus... Hope you can understand my predicament]