Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.3.0 Beta1, 5.11.1, 5.12.0 RC
-
None
-
OS X 10.9.2 Mavericks, macOS High Sierra 10.13.6
Description
When QUiLoader is used in a Qt/MacOS project (example attached), the linker emits many warnings of this type:
ld: warning: direct access in QMetaTypeIdQObject<QWidget*, true>::qt_metatype_id() to global weak symbol QMetaTypeIdQObject<QWidget*, true>::qt_metatype_id()::metatype_id means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
This appears to be due to QtUiTools being compiled with different visibility settings from the rest of Qt. A similar bug was reported (QTBUG-3995) on Qt4.6 but this relationship to QUiLoader is new in Qt5. It may be related, however, as QtUiTools is built as a static library.
Passing -fvisibility=hidden to the compiler can solve this problem for some Qt projects (including the attached example), but it does not always remove the warning.
This occurs on OS 10.9.2 Mavericks, but does not occur on Ubuntu 13.04/13.10.
Attachments
Issue Links
- relates to
-
QTBUG-3995 "Has different visibility" warnings when building static on Mac Cocoa
- Closed
-
QTBUG-93471 Darwin linker warns about global weak symbols when linking an executable against a static Qt
- Closed
-
QTBUG-81297 Linker warnings when building rcc, qmlcachegen and qmlprofiler on Mac
- Closed