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

Why do I get warning "Multiple C++ types called xxx found! This violates the One Definition Rule"

    XMLWordPrintable

Details

    • All
    • 79820c8d6 (dev), 9c6908b49 (6.8)

    Description

      I recently found that Qt tooling gives us the following warning in a larger project with multiple QML components, including C++ code:

      [build] Warning: PlotDataTransformModel.hh:: Multiple C++ types called bda::PlotDataTransformModel found! This violates the One Definition Rule!
      [build] Warning: BaseUIComponent.hh:: Multiple C++ types called bda::BaseUIComponent found! This violates the One Definition Rule!
      

      I tried to investigate if there is anything special about these two classes, but they seem not very different from the many other C++ classes we have. And I checked, there is only a single definition "class BaseUIComponent" and "class PlotDataTransformModel", so the error is slightly confusing for me.

      Is it possible to extend the warning message, so that at least the second occurence of the definition would be listed? That way, I could at least track them down one by one.

      Attachments

        1. qt6ausweisappuiqml_debug_metatypes.json
          252 kB
        2. qml.tar.gz
          1.03 MB
        3. build.log
          2.65 MB
        4. AusweisAppUiQml.qmltypes
          93 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-127133
          # Subject Branch Project Status CR V

          Activity

            People

              qtqmlteam Qt Qml Team User
              emmenlau Mario Emmenlauer
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes