example-service question

Steve Feehan sfeehan at sbb.uvm.edu
Fri Mar 17 19:59:53 PST 2006


I'm playing around with dbus (on Ubuntu Dapper with dbus 0.60) and 
tried to compile the example-service.c in the glib/examples 
directory. Here is what I do:

  dbus-binding-tool --mode=glib-server example-service.xml \
    > example-service-glue.h
  gcc $(pkg-config --cflags dbus-glib-1)   -c -o example-service.o \
    example-service.c

And get the following error:

  In file included from example-service.c:57:
  example-service-glue.h:158: error: '_hello_world' undeclared here (not 
  in a function)
  example-service-glue.h:159: error: '_get_tuple' undeclared here (not 
  in a function)
  example-service-glue.h:160: error: '_get_dict' undeclared here (not in 
  a function)
  example-service.c: In function 'main':
  example-service.c:124: error: 'dbus_glib_some_object_object_info' 
  undeclared (first use in this function)
  example-service.c:124: error: (Each undeclared identifier is reported 
  only once
  example-service.c:124: error: for each function it appears in.)
  example-service.c:124: warning: passing argument 2 of 
  'dbus_g_object_type_install_info' from incompatible pointer type

So I thought that maybe the problem was the lack of an <annotation />
tag in the service xml file. I add the following <annotation /> tag 
to example-service.xml (shown with some context):

<node name="/">
  <interface name="org.designfu.SampleInterface">
  <annotation name="org.freedesktop.DBus.GLib.CSymbol" 
              value="some_object"/>

And then:

  dbus-binding-tool --mode=glib-server example-service.xml \
    > example-service-glue.h
  gcc $(pkg-config --cflags dbus-glib-1)   -c -o example-service.o \
    example-service.c
  example-service.c: In function 'main':
  example-service.c:124: error: 'dbus_glib_some_object_object_info' 
  undeclared (first use in this function)
  example-service.c:124: error: (Each undeclared identifier is 
  reported only once
  example-service.c:124: error: for each function it appears in.)

I'm not sure how to resolve this error. I ran the service xml file
given in the dbus tutorial through dbus-binding-tool and get the 
same result.

Thanks.

-- 
Steve Feehan


More information about the dbus mailing list