Bug 6358 - dbus glib bindings fail with c++
Summary: dbus glib bindings fail with c++
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: GLib (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Rob Taylor
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-23 05:58 UTC by Don Scorgie
Modified: 2007-02-08 17:50 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
A simple program that demonstrates the problem (218 bytes, text/x-c++src)
2006-03-23 05:59 UTC, Don Scorgie
Details
fix (1.38 KB, patch)
2006-10-12 07:19 UTC, Christian Persch (GNOME)
Details | Splinter Review

Description Don Scorgie 2006-03-23 05:58:01 UTC
I feel like I'm doing something stupid, but can't see what it is.  Apologies if
it is stupid.

When compiling a simple test program (which I'll attach in a minute) using g++,
a whole slew of errors are the result:

/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h: In function ‘void
org_freedesktop_DBus_Introspectable_introspect_async_callback(DBusGProxy*,
DBusGProxyCall*, void*)’:
/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h:28: error: invalid
conversion from ‘void*’ to ‘DBusGAsyncData*’
/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h: In function ‘void
org_freedesktop_DBus_request_name_async_callback(DBusGProxy*, DBusGProxyCall*,
void*)’:
/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h:71: error: invalid
conversion from ‘void*’ to ‘DBusGAsyncData*’
/opt/gnome2/include/dbus-1.0/dbus/dbus-glib-bindings.h: In function ‘void
org_freedesktop_DBus_release_name_async_callback(DBusGProxy*, DBusGProxyCall*,
void*)’
...
This continues for a 15 errors.  The same program as a C program works as expected.
Comment 1 Don Scorgie 2006-03-23 05:59:59 UTC
Created attachment 5024 [details]
A simple program that demonstrates the problem

Save file as silly.cpp
compile with
g++ -o silly silly.cpp `pkg-config --cflags --libs dbus-glib-1`
Watch errors appear

Rename silly.cpp to silly.c and  recompile with:
gcc-o silly silly.c `pkg-config --cflags --libs dbus-glib-1`
watch it compile cleanly.
Comment 2 Christian Persch (GNOME) 2006-10-12 07:19:23 UTC
Created attachment 7380 [details] [review]
fix

This fixes dbus-binding-tool to generate C++ compatible bindings.
Comment 3 Rob Taylor 2007-02-08 17:50:26 UTC
Fixed in git head.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.