Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-13162

Symbol redefinition error in unity builds

    XMLWordPrintable

Details

    • 47f356cc2 (dev), f1120eb00 (qds-4.5)
    • QDS Berlin - 2024 Week 27/28

    Description

      Q_LOGGING_CATEGORY line was probably copy pasted to the other file, so they produce an error when they appear in the same translation unit.

      The name of the symbol should probably be changed to match the category better in both cases.

      [build] <path_to_root>/output-windows-x64/debug/_deps/ds-src/src/imports/utils/quickstudiofilereader.cpp:46:27: error: redefinition of 'const QLoggingCategory& texttomodelMergerDebug()'
      [build] 46 | static Q_LOGGING_CATEGORY(texttomodelMergerDebug, "qt.Studiofilereader.debug", QtDebugMsg)
      [build] | ^~~~~~~~~~~~~~~~~~~~~~
      [build] <path_to_root>/output-windows-x64/debug/_deps/ds-src/src/imports/utils/quickstudiocsvtablemodel.cpp:158:27: note: 'const QLoggingCategory& texttomodelMergerDebug()' previously defined here
      [build] 158 | static Q_LOGGING_CATEGORY(texttomodelMergerDebug, "qt.StudioCsvTableModel.debug", QtDebugMsg)
      [build] | ^~~~~~~~~~~~~~~~~~~~~~
      

      Unity build is a build mode in CMake that combines multiple .cpp files together so that is why it leads to these appearing in the same translation unit:
      https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html

      Attachments

        Issue Links

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

          Activity

            People

              thohartm Thomas Hartmann
              poikelin Joni Poikelin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes