Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8, 6.9
-
None
Description
Since Qt 6.8 it's no longer possible to compile iOS project with -ObjC flag because of the compilation error
duplicate symbol '_OBJC_METACLASS_$_WeakPointerLifetimeTracker' in:
/Users/ncuxer/Qt/6.9.0/ios/lib/QtCore.framework/QtCore_debug[arm64][166](qcore_mac.mm.o)
/Users/ncuxer/Qt/6.9.0/ios/lib/QtCore.framework/QtCore_debug[arm64][166](qcore_mac.mm.o)
/Users/ncuxer/Qt/6.9.0/ios/lib/QtCore.framework/QtCore_debug[arm64][166](qcore_mac.mm.o)
/Users/ncuxer/Qt/6.9.0/ios/lib/QtCore.framework/QtCore_debug[arm64][166](qcore_mac.mm.o)
It happens because there are multiple /Users/ncuxer/Qt/6.9.0/ios/lib/QtCore.framework/QtCore_debug entries in "Other Linker flags" in Xcode "Build settings", and ObjC flag causes to load and link symbols from every entry.
It works well in Qt 6.7.3 still, I don't know why exactly but it most probably because before Qt6.8 Qt was linked statically, not as frameworks, and it affects how linker behaves.
You can easily reproduce the issue in any iOS build by adding ObjC flag. For example I've applied this flag to core/permission Qt 6.9 example and attached zip file, but you can do the same with 6.7 to compare the result.
It's still possible to build the iOS version if you go to xcode settings and remove one duplicated entry manually.
QtMultimedia_debug library also causes duplicate symbols issue
Attachments
Issue Links
- relates to
-
QTBUG-132412 Qt6::QIosOptionalPlugin_NSPhotoLibraryPlugin prohibits -ObjC from using
-
- Closed
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-135978 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
643588,7 | CMake: Adjust CMP0156 policy handling for Apple platforms | dev | qt/qtbase | Status: NEW | 0 | -1 |