Problem with dbus on windows 7



  • Hi there and thx for reading and answering if you can.

    I successfully compiled qt 5.4 and dbus 1.8 on windows 7 with mingw-64. The Qt5DBus.dll has been compiled and installed.with the rest of the qt stuff.

    I can launch the dbus daemon with dbus-launch, connect to it with dbus-monitor, however, neither qdbusviewer nor qdbus can connect to the daemon. That being said, qdbus even returns:

    Could not connect to D-Bus server: Unable to load dbus librarries.
    However, the libdbus-1.dll is perfectly accessible.

    What's wrong ? Any indea ?


  • Lifetime Qt Champion

    Hi,

    What do you mean by "perfectly accessible" ? In the same folder os qdbusviewer ?



  • yes, and I also tested another <listen> field in the dbus session.conf with

    tcp:host=127.0.0.1,port=1234

    but no way. It doesn't work



  • Found something !!!

    In the file qdbus_symbols.cpp, from the qt 5.4 sources, go to line 88 and change:
    @lib->setFileName(QLatin1String("dbus-1"));@

    to:

    @#ifdef Q_OS_WIN
    lib->setFileName(QLatin1String("libdbus-1.dll"));
    #else
    lib->setFileName(QLatin1String("dbus-1"));
    #endif@

    I dunno why QLibrary::setFileName() is unable to load the correct dll


  • Lifetime Qt Champion

    Good catch !

    However you shouldn't need the .dll suffix



  • I don't even need to modify the qt source.

    Just rename libdbus-1.dll to dbus-1.dll . That's all :-)

    This small trick could be useful to other devels, since I'm not the only one to strive to port a linux app to win.


  • Lifetime Qt Champion

    Then you should also update the thread title prepending [solved] so other forum users may know a solution has been found :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.