导入不同QT版本的dll

时间:2018-06-26 13:13:45

标签: dll plugins qml qt-creator

我在项目中使用了外部dll文件,现在将我的QT版本从Qt5.5.1升级到了5.10.1。 现在我在使用dll文件时遇到了问题。

  • 是否有机会在更新的QT版本中重复使用相同的dll?
  • 是否为特定的QT版本创建了dll文件?

我已经从Qt5.5.1二进制文件和Qt5.10.1二进制文件运行qmlplugindump.exe:

qmlplugindump com.IO.Plugin 1.0 C:\...\com\IO\Plugin

Qt5.5.1:[作品]

import QtQuick.tooling 1.2

// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump com.IO.Plugin 1.0 C:\Qt\Qt5.10.1\5.10.1\mingw53_32\qml\com\IO\Plugin'

Module {
    dependencies: []
    Component {
... }

Qt5.10.1:[不起作用]

QQmlComponent: Component is not ready
file:///C:/Qt/Qt5.10.1/5.10.1/mingw53_32/qml/com/IO/Plugin/qmldir: plugin cannot be loaded for module "": Cannot load library C:\Qt\Qt5.10.1\5.10.1\mingw53_32\qml\com\IO\Plugin\IOPlugin.dll: Das angegebene Modul wurde nicht gefunden.

Qt5.7.0:[什么都没用(添加到问题27-Aug-2018)]

This plugin does not support createPlatformOpenGLContext!
QQmlComponent: Component is not ready
file:///C:/Qt/Qt5.10.1/5.10.1/mingw53_32/qml/com/IO/Plugin/typelist.qml:2:1: plugin cannot be loaded for module "com.IO.Plugin": Cannot load library C:\Qt\Qt5.7.0\5.7\mingw53_32\qml\com\IO\Plugin\IOPlugin.dll: Das angegebene Modul wurde nicht gefunden.

使用Qt5.5.1-qmlplugindump创建plugins.qmltypes文件会导致Qt5.10.1识别插件而不用红色下划线显示已知的QML组件,但在编译项目时仍会产生以下错误:

plugin cannot be loaded for module "com.IO.Plugin": Die Bibliothek C:\...\release\com\IO\Plugin\IOPlugin.dll kann nicht geladen werden: Das angegebene Modul wurde nicht gefunden. [Translated: can not be loaded: The modul can not be found]
QQmlComponent: Component is not ready

0 个答案:

没有答案