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

Using ListElement with QML Type Compiler leads to link errors

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • 6.5.3
    • QML: Compiler
    • None
    • Windows

    Description

      Test Project and Environment
      This issue has been tested with the minimal reproduction project at the following commit:
      53596881d55c50f876e4897a7d0b5e52f2734a6e

      The project was tested using the Qt 6.5.3 MinGW 64bit kit.

      Issue Description
      When the QML Type Compiler is applied to a QML file containing ListElement, the build process fails with link errors. Below is the build log, which is also attached to this report, showing the undefined reference to QQmlListElement symbols:

      18:47:19: プロジェクト Repeater_QMLTC のステップを実行中...
      18:47:19: 起動中: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build C:/Users/81808/Downloads/Repeater_QMLTC/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug --target clean
      [1/2 16.9/sec] Cleaning additional files...
      [2/2 27.0/sec] Cleaning all built files...
      Cleaning... 32 files.
      18:47:20: プロセス "C:\Qt\Tools\CMake_64\bin\cmake.exe" は正常に終了しました。
      18:47:20: 起動中: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build C:/Users/81808/Downloads/Repeater_QMLTC/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug --target all
      [1/29 8.8/sec] Generating Repeater_QMLTC/CustomQML.qml
      [2/29 17.5/sec] Generating Repeater_QMLTC/Main.qml
      [3/29 16.7/sec] Running qmlimportscanner for appRepeater_QMLTC
      [4/29 16.3/sec] Generating .rcc/qmlcache/appRepeater_QMLTC_qmlcache_loader.cpp
      [5/29 11.9/sec] Automatic MOC and UIC for target appRepeater_QMLTC
      [6/29 12.6/sec] Running rcc for resource qmake_Repeater_QMLTC
      [7/29 14.7/sec] Running rcc for resource appRepeater_QMLTC_raw_qml_0
      [8/29 16.5/sec] Running AUTOMOC file extraction for target appRepeater_QMLTC
      [9/29 16.4/sec] Running moc --collect-json for target appRepeater_QMLTC
      [10/29 14.9/sec] Automatic QML type registration for target appRepeater_QMLTC
      [11/29 13.0/sec] Compiling CustomQML.qml with qmltc
      [12/29 14.0/sec] Compiling Main.qml with qmltc
      [13/29 15.1/sec] Generating .rcc/qmlcache/appRepeater_QMLTC_CustomQML_qml.cpp
      [14/29 16.2/sec] Generating .rcc/qmlcache/appRepeater_QMLTC_Main_qml.cpp
      [15/29 8.6/sec] Generating .qmltc/appRepeater_QMLTC/moc_customqml.cpp
      [16/29 9.2/sec] Generating .qmltc/appRepeater_QMLTC/moc_main.cpp
      [17/29 9.2/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/appRepeater_QMLTC_autogen/mocs_compilation.cpp.obj
      [18/29 9.7/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qrc_qmake_Repeater_QMLTC.cpp.obj
      [19/29 10.3/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qrc_appRepeater_QMLTC_raw_qml_0.cpp.obj
      [20/29 5.3/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/apprepeater_qmltc_qmltyperegistrations.cpp.obj
      [21/29 5.1/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qmlcache/appRepeater_QMLTC_Main_qml.cpp.obj
      [22/29 5.3/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qmlcache/appRepeater_QMLTC_CustomQML_qml.cpp.obj
      [23/29 5.4/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qmlcache/appRepeater_QMLTC_qmlcache_loader.cpp.obj
      [24/29 2.3/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_main.cpp.obj
      [25/29 2.4/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/main.cpp.obj
      [26/29 2.5/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp.obj
      [27/29 2.4/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/main.cpp.obj
      [28/29 2.4/sec] Building CXX object CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/customqml.cpp.obj
      [29/29 2.2/sec] Linking CXX executable appRepeater_QMLTC.exe
      FAILED: appRepeater_QMLTC.exe 
      C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Qt\Tools\mingw1120_64\bin\g++.exe -DQT_QML_DEBUG -g -mwindows CMakeFiles/appRepeater_QMLTC.dir/appRepeater_QMLTC_autogen/mocs_compilation.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/main.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/apprepeater_qmltc_qmltyperegistrations.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qrc_qmake_Repeater_QMLTC.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qmlcache/appRepeater_QMLTC_qmlcache_loader.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qmlcache/appRepeater_QMLTC_Main_qml.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qmlcache/appRepeater_QMLTC_CustomQML_qml.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.rcc/qrc_appRepeater_QMLTC_raw_qml_0.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/main.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/customqml.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_main.cpp.obj CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp.obj -o appRepeater_QMLTC.exe -Wl,--out-implib,libappRepeater_QMLTC.dll.a -Wl,--major-image-version,0,--minor-image-version,0  C:/Qt/6.5.3/mingw_64/lib/libQt6Quick.a  C:/Qt/6.5.3/mingw_64/lib/libQt6OpenGL.a  -luser32  C:/Qt/6.5.3/mingw_64/lib/libQt6Gui.a  -ld3d11  -ldxgi  -ldxguid  C:/Qt/6.5.3/mingw_64/lib/libQt6QmlModels.a  C:/Qt/6.5.3/mingw_64/lib/libQt6Qml.a  C:/Qt/6.5.3/mingw_64/lib/libQt6Network.a  -lws2_32  C:/Qt/6.5.3/mingw_64/lib/libQt6Core.a  -lmpr  -luserenv  -lmingw32  C:/Qt/6.5.3/mingw_64/lib/libQt6EntryPoint.a  -lshell32  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/customqml.cpp.obj:customqml.cpp:(.rdata$.refptr._ZTV15QQmlListElement[.refptr._ZTV15QQmlListElement]+0x0): undefined reference to `vtable for QQmlListElement'
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp.obj: in function `CustomQML_ListModel_ListElement::qt_metacast(char const*)':
      C:/Users/81808/Downloads/Repeater_QMLTC/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp:300: undefined reference to `QQmlListElement::qt_metacast(char const*)'
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp.obj: in function `CustomQML_ListModel_ListElement::qt_metacall(QMetaObject::Call, int, void**)':
      C:/Users/81808/Downloads/Repeater_QMLTC/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp:305: undefined reference to `QQmlListElement::qt_metacall(QMetaObject::Call, int, void**)'
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp.obj: in function `CustomQML_ListModel_ListElement_1::qt_metacast(char const*)':
      C:/Users/81808/Downloads/Repeater_QMLTC/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp:390: undefined reference to `QQmlListElement::qt_metacast(char const*)'
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp.obj: in function `CustomQML_ListModel_ListElement_1::qt_metacall(QMetaObject::Call, int, void**)':
      C:/Users/81808/Downloads/Repeater_QMLTC/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp:395: undefined reference to `QQmlListElement::qt_metacall(QMetaObject::Call, int, void**)'
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp.obj: in function `CustomQML_ListModel_ListElement_2::qt_metacast(char const*)':
      C:/Users/81808/Downloads/Repeater_QMLTC/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp:480: undefined reference to `QQmlListElement::qt_metacast(char const*)'
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp.obj: in function `CustomQML_ListModel_ListElement_2::qt_metacall(QMetaObject::Call, int, void**)':
      C:/Users/81808/Downloads/Repeater_QMLTC/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp:485: undefined reference to `QQmlListElement::qt_metacall(QMetaObject::Call, int, void**)'
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/appRepeater_QMLTC.dir/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/.qmltc/appRepeater_QMLTC/moc_customqml.cpp.obj:moc_customqml.:(.rdata$.refptr._ZN15QQmlListElement16staticMetaObjectE[.refptr._ZN15QQmlListElement16staticMetaObjectE]+0x0): undefined reference to `QQmlListElement::staticMetaObject'
      collect2.exe: error: ld returned 1 exit status
      ninja: build stopped: subcommand failed.
      18:47:33: プロセス "C:\Qt\Tools\CMake_64\bin\cmake.exe" はコード 1 で終了しました。
      18:47:33: プロジェクト Repeater_QMLTC のビルド・デプロイ中にエラーが発生しました (キット Desktop Qt 6.5.3 MinGW 64-bit)
      18:47:33: ステップ "ビルド" 実行中
      18:47:33: 経過時間: 00:14. 

      These errors specifically mention QQmlListElement::qt_metacast, QQmlListElement::qt_metacall, and QQmlListElement::staticMetaObject as undefined references.

      Summary

      • Expected Behavior: Compiling a QML file with ListElement using QML Type Compiler should not produce link errors.
      • Actual Behavior: The linker reports multiple undefined references to QQmlListElement symbols, causing the build to fail.

      This indicates an issue where the QML Type Compiler does not properly link or export the necessary symbols related to QQmlListElement.

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              mikio_hirai Mikio Hirai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes