Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.3
-
None
-
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
For Gerrit Dashboard: QTBUG-119372 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
528079,6 | Extend the Q_IMPORT_QML_PLUGIN documentation | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
529626,2 | Extend the Q_IMPORT_QML_PLUGIN documentation | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
529843,2 | Extend the Q_IMPORT_QML_PLUGIN documentation | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
529911,2 | Extend the Q_IMPORT_QML_PLUGIN documentation | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
529976,2 | Extend the Q_IMPORT_QML_PLUGIN documentation | tqtc/lts-6.2 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |