【问题标题】:QT6.2 QtQuick.Studio.Components Debug and Release version and select (Cannot mix debug and release version)QT6.2 QtQuick.Studio.Components Debug and Release version and select(不能混用debug和release版本)
【发布时间】:2023-01-11 23:55:12
【问题描述】:

我要存档的内容:

在我的应用程序的调试和发布构建版本中使用 QtQuick.Studio.Components。

操作系统:Windows 10

我做了什么:

我在 Qt QML 应用程序(社区版)中使用 QtQuick.Studio.Components 基于我必须手动构建模块的描述,因为该项目使用 qmake 而不是 cmake。

此处描述了构建步骤:

https://codereview.qt-project.org/gitweb?p=qt-labs/qtquickdesigner-components.git;a=blob;f=README.md;h=a9f4c6244be7c2f2e2ef1e85c3b03b62eed5d4d7;hb=HEAD

   1 # Qt Design Studio QML modules
   2 
   3 These modules provide the types  
   4 
   5 # Usage
   6 
   7 The modules get installed into Qt and provide the respective imports for QML.
   8 
   9 # Building
  10 
  11 ```
  12 mkdir build
  13 cd build
  14 cmake -GNinja -DCMAKE_INSTALL_PREFIX=path_to_qt_install_directory path_to_qtquickdesigner-components_cmake
  15 cmake --build .
  16 cmake --install .
  17 ```
  18 
  19 This will install the Qt Design Studio modules in your Qt installation directory.

我的命令调整到我的路径是cmake -GNinja --DCMAKE_INSTALL_PREFIX=C:\Qt\6.4.1\msvc2019_64\ C:\temp\designer2\qtquickdesigner-components

如果我在 QtCreator 中将我的应用程序构建为调试,那么我不会收到错误消息。 如果我在 QtCreator 中构建我的应用程序作为发布,那么我收到错误消息:

'C:/Qt/6.4.1/msvc2019_64/qml/QtQuick/Studio/Components/quickstudiocomponentsplugind.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)

问题:

  • 如何将插件构建为 Release 和 Debug?
  • 我必须如何定义安装前缀,因为我在我的安装中找不到 Qt 调试或 Qt 发布版本?

【问题讨论】:

    标签: qt cmake qml


    【解决方案1】:

    您需要构建它两次。不幸的是,有一个假装重新配置的错误。

    修复在这里https://codereview.qt-project.org/c/qt-labs/qtquickdesigner-components/+/453366

    注意:如果您已经安装了某个版本,则需要在以下位置删除新生成的文件: <path_to_qt_install_directory>/lib/cmake/Qt6Qml/QmlPlugins (按日期排序以查看哪些文件是通过您上次的 qtquickdesigner-components 构建进入的)

    cmake -GNinja -DCMAKE_INSTALL_PREFIX=path_to_qt_install_directory -DCMAKE_BUILD_TYPE=Release path_to_qtquickdesigner-components_cmake && cmake --build . && cmake --install .
    cmake -GNinja -DCMAKE_INSTALL_PREFIX=path_to_qt_install_directory -DCMAKE_BUILD_TYPE=Debug path_to_qtquickdesigner-components_cmake && cmake --build . && cmake --install .
    

    【讨论】:

      猜你喜欢
      • 2013-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-17
      • 1970-01-01
      • 2021-06-09
      • 1970-01-01
      相关资源
      最近更新 更多