Ticket #33 (new compilation error)

Opened 18 months ago

Last modified 17 months ago

gtk plugin fails to build on Debian sid

Reported by: porridge Owned by: darkjames
Priority: major Component: gtk
Version: SVN Keywords: gtkclist gtk
Cc: darkjames@…

Description

Here's the error when building with gcc 4.3.3-5 and libgtk2.0-dev 2.14.7-4+b1.

My gut feeling is that it's caused by a change in gtk headers inclusion order, but I haven't investigated this properly. Just filing this bug here so perhaps someone else can have a look.

if /bin/sh ../../libtool --tag=CC --mode=compile i486-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -DDATADIR=\"/usr/share/ekg2\"  -fvisibility=hidden -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12      -g -O2 -g -O0 -Wall -std=c99 -MT gtk_la-gtkutil.lo -MD -MP -MF ".deps/gtk_la-gtkutil.Tpo" -c -o gtk_la-gtkutil.lo `test -f 'gtkutil.c' || echo './'`gtkutil.c; \
        then mv -f ".deps/gtk_la-gtkutil.Tpo" ".deps/gtk_la-gtkutil.Plo"; else rm -f ".deps/gtk_la-gtkutil.Tpo"; exit 1; fi
 i486-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -DDATADIR=\"/usr/share/ekg2\" -fvisibility=hidden -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -g -O2 -g -O0 -Wall -std=c99 -MT gtk_la-gtkutil.lo -MD -MP -MF .deps/gtk_la-gtkutil.Tpo -c gtkutil.c  -fPIC -DPIC -o .libs/gtk_la-gtkutil.o
In file included from /usr/include/gtk-2.0/gtk/gtk.h:222,
                 from /usr/include/gtk-2.0/gtk/gtksignal.h:32,
                 from /usr/include/gtk-2.0/gtk/gtkclist.h:34,
                 from gtkutil.c:31:
/usr/include/gtk-2.0/gtk/gtkctree.h:110: error: expected specifier-qualifier-list before 'GtkCList'
/usr/include/gtk-2.0/gtk/gtkctree.h:127: error: expected specifier-qualifier-list before 'GtkCListClass'
/usr/include/gtk-2.0/gtk/gtkctree.h:149: error: expected specifier-qualifier-list before 'GtkCListRow'
/usr/include/gtk-2.0/gtk/gtkctree.h:342: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gtk_ctree_node_get_cell_type'
make[4]: *** [gtk_la-gtkutil.lo] Error 1

I tried blindly adding a "#define GTK_DISABLE_DEPRECATED" near the top of the file, but that only changed the error to:

 i486-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -DDATADIR=\"/usr/share/ekg2\" -fvisibility=hidden -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -g -O2 -g -O0 -Wall -std=c99 -MT gtk_la-gtkutil.lo -MD -MP -MF .deps/gtk_la-gtkutil.Tpo -c gtkutil.c  -fPIC -DPIC -o .libs/gtk_la-gtkutil.o
gtkutil.c: In function 'gtkutil_button':
gtkutil.c:367: warning: comparison with string literal results in unspecified behavior
gtkutil.c:368: warning: implicit declaration of function 'gtk_widget_set_usize'
gtkutil.c: In function 'add_tip':
gtkutil.c:472: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
gtkutil.c:472: error: 'tip' undeclared (first use in this function)
gtkutil.c:472: error: (Each undeclared identifier is reported only once
gtkutil.c:472: error: for each function it appears in.)
gtkutil.c:474: warning: implicit declaration of function 'gtk_tooltips_new'
gtkutil.c:475: warning: implicit declaration of function 'gtk_tooltips_set_tip'

Attachments

gtk-clist-deprecated.diff Download (0.7 KB) - added by porridge 17 months ago.

Change History

Changed 18 months ago by porridge

  • priority changed from blocker to major

Changed 17 months ago by porridge

Changed 17 months ago by porridge

Looks like the reason that this fails is that plugins/gtk/gtkutil.c includes gtk/gtkclist.h which defines GtkCList (among other things)

However before that header defines it, it includes gtk/gtksignal.h, which in turn includes gtk/gtk.h, which in turn includes (among many many other headers) gtk/gtkctree.h, which (surprise!) _USES_ GtkCList to define struct _GtkCTree.

So basically it is a circular dependency. The only way that I can see that we can fix it on ekg2's side is simply include <gtk/gtk.h> before the other gtk headers (which inclusions will probably mostly into no-ops at this point).

This is what the attached patch does. I will commit it in a few days if there are no objections.

Whether it should be fixed on GTK+ side is another matter, and how to do this is yet another.

Note: See TracTickets for help on using tickets.