I am upgrading Qt in my solution from Qt5 to Qt6 (6.3). When running a qml based project I receive the error that qtquickcontrols2plugin.dll cannot be loaded - a specified module is missing. I have checked with dependency walker and the .dll needs the Qt6Qml.dll, Qt6Core.dll, Qt6QuickControls2.dll which are all near the executable file in the deployment directory.
The plugin dll is under the directory folder_with_executable\QtQuick\Controls. The qmldir file looks as follows:
module QtQuick.Controls
linktarget Qt6::qtquickcontrols2plugin
plugin qtquickcontrols2plugin
classname QtQuickControls2Plugin
designersupported
typeinfo plugins.qmltypes
import QtQuick.Controls.impl auto
optional import QtQuick.Controls.Basic auto
optional import QtQuick.Controls.Fusion auto
optional import QtQuick.Controls.Material auto
optional import QtQuick.Controls.Imagine auto
optional import QtQuick.Controls.Universal auto
optional import QtQuick.Controls.Windows auto
optional import QtQuick.Controls.macOS auto
prefer :/qt-project.org/imports/QtQuick/Controls/
Can anyone please help ? Is the folder directory for qml correct ? I am deploying for windows on windows 10 with the precompiled mingw Qt dlls.
CodePudding user response:
Seems that your answer is solved with windeployqt
. That is the recommended way to package your application on Windows since you never know when newer dependencies may creep in but you can rely on the fact that Qt will keep that tool up to date.