Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.0.3, 6.1.0 RC, 6.2
-
None
-
-
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
- relates to
-
QTBUG-93021 Qt6 Static build for macOS problem: Undefined symbols for architecture x86_64 and issues with libraries linking.
- Closed
-
QTBUG-93230 Conflict name for qt_add_resources
- Closed
For Gerrit Dashboard: QTBUG-93172 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
345445,3 | CMake: Avoid duplicate symbol errors due to a common resource name | dev | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
345909,2 | CMake: Avoid duplicate symbol errors due to a common resource name | 6.1 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
345910,2 | CMake: Avoid duplicate symbol errors due to a common resource name | 6.0 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |