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

QtDBus export macros are broken and outdated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.1
    • 4.7.0
    • D-Bus
    • None
    • win32-msvc2008
    • f1d7cbd9efbdade9df5496dc684c2f7d22db7378

    Description

      Qt doesn't build anymore on Windows when QtDBus is enabled, with some linker errors in src/plugins/script/qtdbus complaining about missing staticMetaObject symbols.

      This is caused by the export macros, specifically the importing part, which isn't set to dllimport as it should (from dbus/qdbusmacros.h) :

      #if defined(QDBUS_MAKEDLL)

      1. define QDBUS_EXPORT Q_DECL_EXPORT
        #elif defined(QT_SHARED)
      2. define QDBUS_EXPORT Q_DECL_IMPORT
        #else
      3. define QDBUS_EXPORT
        #endif

      QT_SHARED is an obsolete symbol which isn't set anymore, now replaced by QT_DLL.

      More generally, the export macros for the QtDBus module are outdated and they don't follow the structure and naming standards like the other modules (all defined in qglobal.h).

      See merge request #2439 for a fix : http://qt.gitorious.org/qt/qt/merge_requests/2439
      The patch solves the linking errors by fixing the export macro, and moves the definition to qglobal.h together with the other modules. It also renames QDBUS_EXPORT to Q_DBUS_EXPORT to follow the export macro naming standard.

      This change is binary compatible as it doesn't change any symbol nor the way they are exported, it only has an effect on the importing side (but if it compiled fine before it'll continue to do so).
      It should be source compatible as well for all the headers from QtDBus. However if a client manually imported a method by using QDBUS_EXPORT in his code, then this will break, but this is a fairly unusual case (only one occurence found in KDE-kdelibs, to import a "hidden method" from QtDBus)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tmacieir Thiago Macieira (closed Nokia identity) (Inactive)
            romain_kdab Romain Pokrzywka (KDAB) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes