当前位置: 代码迷 >> MeeGo >> dbus_connection_setup_with_g_main()的有关问题
  详细解决方案

dbus_connection_setup_with_g_main()的有关问题

热度:10391   发布时间:2013-02-26 00:00:00.0
dbus_connection_setup_with_g_main()的问题
Hi, 

I meet a build error says: 'dbus_connection_setup_with_g_main' was not declared in this scope. 

I have included the following headfiles, and used the gcc option: `pkg-config --cflags --libs dbus-glib-1` 

#include <glib.h> 
#include <dbus/dbus.h> 
#include <dbus/dbus-glib.h> 

But, some other APIs in the same code can be found by gcc, such as:dbus_bus_add_match(), dbus_connection_add_filter(), g_main_loop_new() and g_main_loop_run() 

Any suggestion? Thank you very much!
------解决方案--------------------------------------------------------
the same question as you...
------解决方案--------------------------------------------------------
please refer to this url for detail:
http://dbus.freedesktop.org/doc/dbus-glib/dbus-glib-DBus-GLib-low-level

#include <dbus/dbus-glib-lowlevel.h>

void                dbus_set_g_error                    (GError **gerror,
                                                         DBusError *derror);
void                dbus_connection_setup_with_g_main   (DBusConnection *connection,
                                                         GMainContext *context);
DBusGConnection *   dbus_connection_get_g_connection    (DBusConnection *connection);
void                dbus_server_setup_with_g_main       (DBusServer *server,
                                                         GMainContext *context);
#define             DBUS_TYPE_CONNECTION
#define             DBUS_TYPE_MESSAGE