Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119372

build fails with Q_IMPORT_QML_PLUGIN macro

    XMLWordPrintable

Details

    • 48241a49d (dev), db9171d0c (6.7), ab160d2cb (6.6), 890a22aa3 (tqtc/lts-6.5), 7ad0c7d8b (tqtc/lts-6.2)

    Description

      When building project with QML module subdirectory which located at same or above level of directory hierarchy, build fails:

      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/testapp.dir/main.cpp.obj:main.cpp:(.text.startup+0xa): undefined reference to `qt_static_plugin_extramodulePlugin()'
      collect2.exe: error: ld returned 1 exit status
      ninja: build stopped: subcommand failed.
      09:06:51: The process "C:\Qt\Tools\CMake_64\bin\cmake.exe" exited with code 1.
      Error while building/deploying project testapp (kit: Desktop Qt 6.5.3 MinGW 64-bit)
      When executing step "Build"

       

      In docs stated:

      Q_IMPORT_QML_PLUGIN(PluginName)
      Ensures the plugin whose metadata-declaring class is named PluginName is linked into static builds.

      also:

      Note: When using static linking, it might be necessary to use Q_IMPORT_QML_PLUGIN to ensure that the QML plugin is correctly linked.

       
      also Q_IMPORT_QML_PLUGIN used in latest QtCreator/QtDesignStudio code templates for new projects

      But, without  Q_IMPORT_QML_PLUGIN(extramodulePlugin) project builds and run fine. Its unclean: does Q_IMPORT_QML_PLUGIN macro required at all? I suggest Q_IMPORT_QML_PLUGIN only required when NO_PLUGIN option used in qt_add_qml_module()

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            semlanik Alexey Edelev
            morte Maxim Bescherevnykh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes