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

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • 6.7.2
    • QML: Tooling
    • None
    • 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

        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
              emmenlau Mario Emmenlauer
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes