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

QtUiTools causes "different visibility settings" warnings on Mac OS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.3.0 Beta1, 5.11.1, 5.12.0 RC
    • Core: Object Model
    • None
    • OS X 10.9.2 Mavericks, macOS High Sierra 10.13.6
    • macOS

      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.

        1. visibilitytest.zip
          3 kB
          William Overall
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            wro William Overall
            Votes:
            2 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes