After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654782 - [Bug] valac doesn't add #include <gio/gio.h> when the file doesn't include "main"‏
[Bug] valac doesn't add #include <gio/gio.h> when the file doesn't include "m...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.12.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 649821 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-07-17 14:18 UTC by Tal
Modified: 2011-07-18 08:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a whole example package of this bug (2.47 KB, application/x-bzip)
2011-07-17 14:18 UTC, Tal
Details

Description Tal 2011-07-17 14:18:50 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
Comment 1 Tal 2011-07-17 14:27:37 UTC
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 :-)
Comment 2 Luca Bruno 2011-07-18 08:01:42 UTC
*** Bug 649821 has been marked as a duplicate of this bug. ***
Comment 3 Luca Bruno 2011-07-18 08:08:27 UTC
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.