GNOME Bugzilla – Bug 654782
[Bug] valac doesn't add #include <gio/gio.h> when the file doesn't include "main"
Last modified: 2011-07-18 08:08:27 UTC
Created attachment 192129 [details] a whole example package of this bug When the user add --pkg gio-2.0, not all generated C files include this line: #include <gio/gio.h> As far as I understood, only files with the "DBus" attribute includes this line in C. There is to ways to handle it: 1. Add all the generated C files this line.(simple) 2. Check for every file weather it depends on GIO-2.0.(complicated) Approach 1 seams the best. This cause this error to occur when compiling the C files: Foo.vala.c:54:45: error: unknown type name ‘GDBusConnection’ error: cc exited with status 256 The following error is from the attached example. Hope I made myself clear Tal
Sorry for duplicating this bag. I've found the same bag report here: https://bugzilla.gnome.org/show_bug.cgi?id=649821 The good thing was that I provided an example :-)
*** Bug 649821 has been marked as a duplicate of this bug. ***
commit ccd3a999052f074aa74dc9581a203edeba5e04d1 Author: Luca Bruno <lucabru@src.gnome.org> Date: Mon Jul 18 10:01:25 2011 +0200 D-Bus: Include gio.h when using the register_object function Fixes bug 654782. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.