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

Duplicate symbol qInitResources_qmake_immediate when building qtquickcontrols2 gallery example against static macOS Qt

    XMLWordPrintable

Details

    • macOS
    • cc2d45fd72a764312be9757ef96cc9abd5d1b423 (qt/qtquickcontrols2/dev) 2d0133cbcfffeb507a3d4122ecdfdf20b5dee35e (qt/qtquickcontrols2/6.1) 7d141071101e99c57eda9bb89cc91dbf03deaebe (qt/qtquickcontrols2/6.0)

    Description

      Trying to build the qtquickcontrols2 gallery example on macOS against a static Qt build with CMake fails to link due to duplicate symbols.

      duplicate symbol 'qInitResources_qmake_immediate()' in:
          CMakeFiles/gallery_controls2.dir/.rcc/qmlcache/qmake_immediate/qmlcache_loader.cpp.o
          /Volumes/T3/Dev/qt/qt5_cmake/builds/6.1-mac-static-super-src-rc1/installed/lib/objects-Release/qtquickcontrols2nativestyleplugin_resources_2/.rcc/qmlcache/qmake_immediate/qmlcache_loader.cpp.o
      

      This happens because both the qtquickcontrols2 native mac style plugin and the gallery example create a resource with the same name "qmake_immediate" which was generated by pro2cmake when converting pro files.

      This is kind of a fundamental issue because we don't insert the target name into the generated resource name and thus there's always a chance for name conflicts in the resource initializer function name. We don't modify the resource name to be unique, because user code might depend on the given resource name.

      Thus we have to ensure that at all Qt built targets (qt modules, qt plugins, qt qml plugins) that are built as part of the Qt SDK don't use a resource name that could conflict with user resource names.

      Attachments

        Issue Links

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

          Activity

            People

              alexandru.croitor Alexandru Croitor
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes