You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 25.04编译Noteahead时出现CMake QML链接目标不存在警告

在Ubuntu 25.04构建Noteahead MIDI音序器时的CMake警告问题

我尝试在Ubuntu 25.04上构建Noteahead MIDI音序器,过程中出现大量如下CMake警告:

CMake Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt6Qml/Qt6QmlMacros.cmake:4253 (message):
  The qml plugin 'qtquick2plugin' is a dependency of 'noteahead', but the
  link target it defines (Qt6::qtquick2plugin) does not exist in the current
  scope.  The plugin will not be linked.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:745 (qt6_import_qml_plugins)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:745 (cmake_language)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:823 (_qt_internal_finalize_executable)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:792:EVAL:1 (qt6_finalize_target)
  src/CMakeLists.txt:DEFERRED


CMake Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt6Qml/Qt6QmlMacros.cmake:4253 (message):
  The qml plugin 'qmlplugin' is a dependency of 'noteahead', but the link
  target it defines (Qt6::qmlplugin) does not exist in the current scope.
  The plugin will not be linked.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:745 (qt6_import_qml_plugins)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:745 (cmake_language)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:823 (_qt_internal_finalize_executable)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:792:EVAL:1 (qt6_finalize_target)
  src/CMakeLists.txt:DEFERRED

请问这是什么原因?该问题在Ubuntu 24.04或24.10中并未出现。不过尽管存在这些警告,应用在Ubuntu 25.10上仍能正常运行。


问题原因与解释

  • 核心原因是Ubuntu 25.04中Qt6的CMake工具链版本更新,和Ubuntu 24.xx系列的Qt6 CMake宏逻辑存在差异:
    • Qt6的qt6_import_qml_plugins宏在新版本中调整了系统QML插件(如qtquick2plugin)的处理逻辑,不再为这类系统插件生成Qt6::qtquick2plugin形式的链接目标
    • 项目的CMake配置仍沿用旧的插件依赖检测逻辑,导致CMake在验证依赖时找不到对应的链接目标,从而抛出警告
  • 应用能正常运行的原因:这些警告涉及的都是系统级QML插件,Ubuntu 25.04的Qt运行时环境已默认包含并能自动加载这些插件,无需编译阶段显式链接。

内容的提问来源于stack exchange,提问作者juzzlin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 06:13:15