Problem with dbus on windows 7
-
wrote on 29 Dec 2014, 19:06 last edited by
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 ?
-
Hi,
What do you mean by "perfectly accessible" ? In the same folder os qdbusviewer ?
-
wrote on 29 Dec 2014, 23:14 last edited by
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
-
wrote on 30 Dec 2014, 16:47 last edited by
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
-
Good catch !
However you shouldn't need the .dll suffix
-
wrote on 31 Dec 2014, 16:39 last edited by
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.
-
Then you should also update the thread title prepending [solved] so other forum users may know a solution has been found :)
7/7