I played with GLib D-Bus bindings, trying to get something (something) to work with very limited success. I am trying to get Ross Burton sample code to compile and run, but continue to face new and exciting difficulties.
Can you help debug this code or, if that fails, point me to some example of a D-Bus GLib code that works?
Since Ross code is outdated, I replaced the line
dbus_g_object_class_install_info (G_OBJECT_CLASS (echo_class), &dbus_glib_echo_object_info);
from
dbus_g_object_type_install_info (G_OBJECT_TYPE (echo_class), &dbus_glib_echo_object_info);
for his comments on this article, but made no other changes than updating the include directories to match the setting in my field.
When I run the server executable, I get the following error:
** (process:11747): CRITICAL **: dbus_g_object_type_install_info: assertion `G_TYPE_IS_CLASSED (object_type) || G_TYPE_IS_INTERFACE (object_type)' failed
The stack trace at this point, according to gdb,
#0 0x0000003b5f40b440 in dbus_g_object_type_install_info () from /usr/lib64/libdbus-glib-1.so.2
I am not sure what is going wrong, or what should be done when debugging. I would like to get the basic code for sending and receiving messages about calling the D-Bus method, so I can see how everything should work in my application.
I am using D-Bus 0.73.
Update . Given the lack of success on my part and the lack of an answer here, I am now looking at dropping D-Bus and looking for another IPC mechanism.
Update 2 . In the end, I went with a UNIX approach called sockets, which does exactly what I need to do a total of 280 lines of code (plus test code).