Bug 750023 - references to glib headers other than glib.h
Summary: references to glib headers other than glib.h
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: meanwhile
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Josh Boyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 750024
TreeView+ depends on / blocked
 
Reported: 2011-10-30 02:09 UTC by Rex Dieter
Modified: 2012-03-23 19:32 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-11-18 19:00:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Rex Dieter 2011-10-30 02:09:21 UTC
Trying to build kopete, a meanwhile consumer, but fails on rawhide:

/usr/include/glib-2.0/glib/glist.h:28:2: error: #error "Only <glib.h> can be included directly."

$ grep -r glib /usr/include/meanwhile | grep -v glib.h
/usr/include/meanwhile/mw_srvc_dir.h:#include <glib/glist.h>
/usr/include/meanwhile/mw_srvc_conf.h:#include <glib/glist.h>
/usr/include/meanwhile/mw_st_list.h:#include <glib/glist.h>
/usr/include/meanwhile/mw_srvc_place.h:#include <glib/glist.h>
/usr/include/meanwhile/mw_message.h:#include <glib/glist.h>
/usr/include/meanwhile/mw_srvc_resolve.h:#include <glib/glist.h>

See also,
http://lists.fedoraproject.org/pipermail/devel/2011-October/158746.html

"It was pointed out that some changes in GLib 2.31 may cause some fallout
and may be worth calling out explicitly:

- it is no longer possible to include individual headers. If your
package runs into this problem, just replace the problematic includes
with #include <glib.h>
...
"

Comment 1 Josh Boyer 2011-11-18 19:00:10 UTC
Should be fixed in rawhide

Comment 2 Antonio T. (sagitter) 2012-03-23 17:11:17 UTC
I have the below error; is it the same bug ?

...
make  all-recursive
make[1]: Entering directory `/home/sagitter/rpmbuild/SOURCES/librcc-0.2.9'
Making all in src
make[2]: Entering directory `/home/sagitter/rpmbuild/SOURCES/librcc-0.2.9/src'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/sagitter/rpmbuild/SOURCES/librcc-0.2.9/src'
Making all in engines
make[2]: Entering directory `/home/sagitter/rpmbuild/SOURCES/librcc-0.2.9/engines'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/sagitter/rpmbuild/SOURCES/librcc-0.2.9/engines'
Making all in external
make[2]: Entering directory `/home/sagitter/rpmbuild/SOURCES/librcc-0.2.9/external'
gcc -DHAVE_CONFIG_H -I. -I..  -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include     -I../src   -g -O2 -Wall -Wpointer-arith -MT rccexternal.o -MD -MP -MF .deps/rccexternal.Tpo -c -o rccexternal.o rccexternal.c
In file included from rccexternal.c:59:0:
/usr/include/glib-2.0/glib/gthread.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gthread.h:34:0,
                 from rccexternal.c:59:
/usr/include/glib-2.0/glib/gatomic.h:23:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gatomic.h:29:0,
                 from /usr/include/glib-2.0/glib/gthread.h:34,
                 from rccexternal.c:59:
/usr/include/glib-2.0/glib/gtypes.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/lib64/glib-2.0/include/glibconfig.h:9:0,
                 from /usr/include/glib-2.0/glib/gtypes.h:34,
                 from /usr/include/glib-2.0/glib/gatomic.h:29,
                 from /usr/include/glib-2.0/glib/gthread.h:34,
                 from rccexternal.c:59:
/usr/include/glib-2.0/glib/gmacros.h:32:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gtypes.h:35:0,
                 from /usr/include/glib-2.0/glib/gatomic.h:29,
                 from /usr/include/glib-2.0/glib/gthread.h:34,
                 from rccexternal.c:59:
/usr/include/glib-2.0/glib/gmacros.h:32:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gtypes.h:36:0,
                 from /usr/include/glib-2.0/glib/gatomic.h:29,
                 from /usr/include/glib-2.0/glib/gthread.h:34,
                 from rccexternal.c:59:
/usr/include/glib-2.0/glib/gversionmacros.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gthread.h:35:0,
                 from rccexternal.c:59:
/usr/include/glib-2.0/glib/gerror.h:22:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gerror.h:30:0,
                 from /usr/include/glib-2.0/glib/gthread.h:35,
                 from rccexternal.c:59:
/usr/include/glib-2.0/glib/gquark.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gquark.h:34:0,
                 from /usr/include/glib-2.0/glib/gerror.h:30,
                 from /usr/include/glib-2.0/glib/gthread.h:35,
                 from rccexternal.c:59:
/usr/include/glib-2.0/glib/gtypes.h:28:2: error: #error "Only <glib.h> can be included directly."
rccexternal.c: In function ‘main’:
rccexternal.c:173:3: warning: implicit declaration of function ‘g_thread_create’ [-Wimplicit-function-declaration]
make[2]: *** [rccexternal.o] Error 1
make[2]: Leaving directory `/home/sagitter/rpmbuild/SOURCES/librcc-0.2.9/external'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/sagitter/rpmbuild/SOURCES/librcc-0.2.9'
make: *** [all] Error 2

Comment 3 Rex Dieter 2012-03-23 19:28:25 UTC
Yours is a different problem, newer versions of glib2 don't allow apps to #include anything but glib.h anymore.  You'll need to patch the app to drop
references to things like gthread.h gerror.h, etc... and only use
#include <glib.h>

Comment 4 Kevin Kofler 2012-03-23 19:32:16 UTC
Sorta. It's the same problem, but in a different codebase. Unfortunately, every package including individual GLib headers directly needs to be fixed separately. (It's sad that GLib decided to gratuitously break backwards compatibility this way, but it's intentional and they will not change it.)


Note You need to log in before you can comment on or make changes to this bug.