0

I have made a Qt application. I have copied the necessary dlls to the application folder such as QT5CORE.DLL , QT5GUI.DLL , QT5WIDGETS.DLL but the application is asking for dlls such as Qt5Positioning.dll, Qt5Sensors.dll, Qt5PrintSupport.dll, Qt5Qml.dll etc even if they are not used in the program. I get such error on application start "This program cannot start because blahblah.dll is missing from your computer. Reinstalling may fix this problem."

I am getting this error in Qt5.2.1 and i am using VS 2010.

Here is the .pro file:

TEMPLATE = app
TARGET = mainwindow
DESTDIR = ../Win32/Release
QT += core network widgets gui webkitwidgets
CONFIG += release
DEFINES += WIN64 QT_DLL QT_NETWORK_LIB QT_WIDGETS_LIB QT_WEBKITWIDGETS_LIB
INCLUDEPATH += ./GeneratedFiles \
. \
./GeneratedFiles/Release
DEPENDPATH += .
MOC_DIR += ./GeneratedFiles/release
OBJECTS_DIR += release
UI_DIR += ./GeneratedFiles
RCC_DIR += ./GeneratedFiles
include(mainwindow.pri)
win32:RC_FILE = mainwindow.rc
user221458
  • 716
  • 2
  • 7
  • 17
  • Are you using the Qt Plugin for Visual Studio? If so, you can check the Qt project settings for modules included in the application. Maybe there the ones demanded are checked there for some reason. – Bowdzone Apr 07 '14 at 08:19
  • You can also add the Qt bin folder to your PATH. VS2010 will then automatically look for DLLs in that directory during linking. – ManuelH Apr 07 '14 at 08:21
  • Yes I am using Qt Plugin for Visual Studio. I have selected the following Qt modules while creating the project: Core, GUI, Network, Webkit Widgets, Widgets. I have not selected any other module but why does the application asks for dll files such as Qt5Multimedia.dll, Qt5Qml etc.? – user221458 Apr 07 '14 at 08:23
  • @ManuelH I have already added the path and is running fine in VS. But I want to publish my program and don't want to ship these unnecessary dlls with my program. – user221458 Apr 07 '14 at 08:25
  • And you are definitely not using any functions which may be from these dlls? I am not sure to which module they belong and if you need the additional modules checked in your settings. If not maybe try deselecting some and recompile – Bowdzone Apr 07 '14 at 08:31
  • The deployment article for Qt5 maybe a useful reference for this issue https://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html – ManuelH Apr 07 '14 at 08:33
  • I have pasted the pro file contents in the question. – user221458 Apr 07 '14 at 08:37

1 Answers1

2

The module WebKitWidgets depends on:

  • Qt5MultimediaWidgets.dll
  • Qt5OpenGL.dll
  • Qt5PrintSupport.dll
  • Qt5WebKit.dll
  • Qt5Multimedia.dll
  • Qt5Widgets.dll
  • Qt5Network.dll
  • Qt5Sensors.dll
  • Qt5Gui.dll
  • Qt5Core.dll
  • MSVCP100.dll and MSVCR100.dll
  • (KERNEL32.dll)

That's why you need those DLLs. If you don't want to ship all these, consider removing the webkitwidgets module.

You can inspect your application dependencies using tools like dependency walker or CFF explorer. These tools prove helpful when you have these kind of problems, you can easily explore dependencies and dependencies of the dependencies in your case ;)

Uflex
  • 1,396
  • 1
  • 13
  • 32