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

-dbus-linked does not work when cross-compiling from Windows



    • Type: Bug
    • Status: Open
    • Priority: P4: Low
    • Resolution: Unresolved
    • Affects Version/s: 5.0.0, 5.0.1, 5.0.2
    • Fix Version/s: None
    • Component/s: D-Bus
    • Labels:


      When building with -dbus-linked on a Linux system, the variables $$QT_CFLAGS_DBUS and $$QT_LIBS_DBUS get populated by pkg-config. $$QT_CFLAGS_DBUS contains the include paths for the D-Bus library (e.g. -I/usr/include/dbus-1.0), and is always added into the build. $$QT_LIBS_DBUS contains the library (e.g. -ldbus-1), and is added to the build only when building with -dbus-linked. This part works fine.

      However, when building on Windows, pkg-config is not available. In order to build against D-Bus, the user sets the variable DBUS_PATH instead, which provides a location for the header files and libraries to be found. This is sufficient to build the dynamic mode of QtDbus (-dbus), but it doesn't handle adding in the -ldbus-1 line which would be necessary for -dbus-linked to work properly.

      When native building for Windows, some special win32-specific code takes care of adding -ldbus-1. However, if cross-building to another platform from Windows, this code doesn't get run, so -ldbus-1 is never added to the link. This effectively means that -dbus-linked does not work properly in this case.

      I believe the right solution here is to remove the -ldbus-1 code from the special win32 block in dbus.pro, and instead add a line that says "QT_LIBS_DBUS = -ldbus-1" up in the DBUS_PATH block, which would simulate what normally happens via pkg-config. Then the normal code that handles -dbus-linked would take care of adding it to the build when the user builds with that mode. I'm not positive that this would catch all of the build cases, but it seems like it would be the right way to handle this problem. Does that sound right?


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



            • Assignee:
              thiago Thiago Macieira
              fischerm Matt Fischer
            • Votes:
              0 Vote for this issue
              4 Start watching this issue


              • Created:

                Gerrit Reviews

                There are no open Gerrit changes