运行exe报“plugin cannot be loaded for module “QtQuick.Controls“: Cannot load library”错误解决

我们用VS2019+Qt5.12.8开发的时候,里面用了QtQuick.Controls,只要2.x以上,运行时会提示plugin cannot be loaded for module “QtQuick.Controls“: Cannot load library等错误。
错误如下:


plugin cannot be loaded for module "QtQuick.Controls": Cannot load library F:\Qt\Qt5.12.8\5.12.8\msvc2017_64\qml\QtQuick\Controls.2\qtquickcontrols2plugin.dll

解决方法,在Qt的对应版本里,搜索:

Qt5QuickTemplates2.dll
Qt5QuickControls2.dll

这两个dll放入exe目录即可。

你可能感兴趣的:(运行exe报“plugin cannot be loaded for module “QtQuick.Controls“: Cannot load library”错误解决)