Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-296

Having qsTr() inside ListModel causes a link error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • Qt for MCUs 2.8.1
    • Qt for MCUs 2.7
    • QML, QUL Team
    • None

    Description

      In the attached project, there are two almost identical ListView in CustomListView1.qml and CustomListView2.qml.

      When you build this project with Qt for MCUs 2.7(I've tested 2.7 mingw and msvc), you'll see this link error.

      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ListViewQsTrLinkError.dir/CMakeFiles/ListViewQsTrLinkError.dir/CustomListView2.cpp.obj: in function `listview_model_0_word_binding()':
      C:/Users/81808/build-ListViewQsTrLinkError-Qt_for_MCUs_2_7_Desktop_32bpp_MINGW-Debug/CMakeFiles/ListViewQsTrLinkError.dir/CustomListView2.cpp:62: multiple definition of `listview_model_0_word_binding()'; CMakeFiles/ListViewQsTrLinkError.dir/CMakeFiles/ListViewQsTrLinkError.dir/CustomListView1.cpp.obj:C:/Users/81808/build-ListViewQsTrLinkError-Qt_for_MCUs_2_7_Desktop_32bpp_MINGW-Debug/CMakeFiles/ListViewQsTrLinkError.dir/CustomListView1.cpp:62: first defined here
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/ListViewQsTrLinkError.dir/CMakeFiles/ListViewQsTrLinkError.dir/CustomListView2.cpp.obj: in function `listview_model_1_word_binding()':
      C:/Users/81808/build-ListViewQsTrLinkError-Qt_for_MCUs_2_7_Desktop_32bpp_MINGW-Debug/CMakeFiles/ListViewQsTrLinkError.dir/CustomListView2.cpp:70: multiple definition of `listview_model_1_word_binding()'; CMakeFiles/ListViewQsTrLinkError.dir/CMakeFiles/ListViewQsTrLinkError.dir/CustomListView1.cpp.obj:C:/Users/81808/build-ListViewQsTrLinkError-Qt_for_MCUs_2_7_Desktop_32bpp_MINGW-Debug/CMakeFiles/ListViewQsTrLinkError.dir/CustomListView1.cpp:70: first defined here
      collect2.exe: error: ld returned 1 exit status 

      In the generated .cpp files, there is indeed a conflict.

      Attachments

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

        Activity

          People

            samuelmira Samuel Mira
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes