Trying to compile a simple example taken from:
http://library.gnome.org/devel/gtk-tutorial/stable/c39.html#SEC-HELLOWORLD
...code below...
#v+
#include <gtk/gtk.h>
int main( int argc,
char *argv[] )
{
GtkWidget *window;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);
gtk_main ();
return 0;
}
#v-
...I've got in return a lot of errors (below). Of course, it's not possible,
that GTK2 in OpenBSD 4.2 is in "totally broken" state ;) - so I'm just
missing something. But what exactly? "pkg-config" seems to "see" all the
needed included files and libraries. So, why so much error messages?
#v+
[EMAIL PROTECTED] cc base.c -o base `pkg-config --cflags --libs gtk+-2.0`
In file included from /usr/local/include/gtk-2.0/gdk/gdktypes.h:32,
from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/glib-1.2/glib.h:510: error: conflicting types for `gssize'
/usr/local/lib/glib-2.0/include/glibconfig.h:58: error: previous declaration of
`gssize'
/usr/local/include/glib-1.2/glib.h:511: error: conflicting types for `gsize'
/usr/local/lib/glib-2.0/include/glibconfig.h:59: error: previous declaration of
`gsize'
In file included from /usr/local/include/glib-2.0/glib-object.h:29,
from /usr/local/include/pango-1.0/pango/pango-types.h:26,
from /usr/local/include/pango-1.0/pango/pango-font.h:26,
from /usr/local/include/pango-1.0/pango/pango-attributes.h:25,
from /usr/local/include/pango-1.0/pango/pango.h:25,
from /usr/local/include/gtk-2.0/gdk/gdktypes.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/glib-2.0/gobject/gparamspecs.h:202: error: syntax error
before "gunichar"
/usr/local/include/glib-2.0/gobject/gparamspecs.h:346: error: syntax error
before "gunichar"
In file included from /usr/local/include/glib-2.0/glib-object.h:31,
from /usr/local/include/pango-1.0/pango/pango-types.h:26,
from /usr/local/include/pango-1.0/pango/pango-font.h:26,
from /usr/local/include/pango-1.0/pango/pango-attributes.h:25,
from /usr/local/include/pango-1.0/pango/pango.h:25,
from /usr/local/include/gtk-2.0/gdk/gdktypes.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/glib-2.0/gobject/gsourceclosure.h:30: error: syntax error
before '*' token
In file included from /usr/local/include/glib-2.0/glib-object.h:36,
from /usr/local/include/pango-1.0/pango/pango-types.h:26,
from /usr/local/include/pango-1.0/pango/pango-font.h:26,
from /usr/local/include/pango-1.0/pango/pango-attributes.h:25,
from /usr/local/include/pango-1.0/pango/pango.h:25,
from /usr/local/include/gtk-2.0/gdk/gdktypes.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/glib-2.0/gobject/gvaluearray.h:64: error: syntax error
before "GCompareDataFunc"
In file included from /usr/local/include/pango-1.0/pango/pango-font.h:26,
from /usr/local/include/pango-1.0/pango/pango-attributes.h:25,
from /usr/local/include/pango-1.0/pango/pango.h:25,
from /usr/local/include/gtk-2.0/gdk/gdktypes.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/pango-1.0/pango/pango-types.h:141: error: syntax error
before "ch"
/usr/local/include/pango-1.0/pango/pango-types.h:146: error: syntax error
before "ch"
In file included from /usr/local/include/pango-1.0/pango/pango-types.h:152,
from /usr/local/include/pango-1.0/pango/pango-font.h:26,
from /usr/local/include/pango-1.0/pango/pango-attributes.h:25,
from /usr/local/include/pango-1.0/pango/pango.h:25,
from /usr/local/include/gtk-2.0/gdk/gdktypes.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/pango-1.0/pango/pango-script.h:116: error: syntax error
before "ch"
In file included from /usr/local/include/pango-1.0/pango/pango.h:25,
from /usr/local/include/gtk-2.0/gdk/gdktypes.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/pango-1.0/pango/pango-attributes.h:266: error: syntax error
before "gunichar"
In file included from /usr/local/include/pango-1.0/pango/pango.h:39,
from /usr/local/include/gtk-2.0/gdk/gdktypes.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/pango-1.0/pango/pango-layout.h:114: error: syntax error
before "gunichar"
In file included from /usr/local/include/pango-1.0/pango/pango.h:45,
from /usr/local/include/gtk-2.0/gdk/gdktypes.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcolor.h:31,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:23,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/pango-1.0/pango/pango-utils.h:109: error: syntax error
before "ch"
In file included from /usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkpixbuf.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:24,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:127: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:131: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:136: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:151: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:168: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:176: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:182: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:189: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:198: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:206: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-core.h:215: error: syntax
error before "GError"
In file included from /usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:35,
from /usr/local/include/gtk-2.0/gdk/gdkpixbuf.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:24,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-animation.h:56: error: syntax
error before "GError"
In file included from /usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf.h:38,
from /usr/local/include/gtk-2.0/gdk/gdkpixbuf.h:33,
from /usr/local/include/gtk-2.0/gdk/gdkcairo.h:24,
from /usr/local/include/gtk-2.0/gdk/gdk.h:30,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-loader.h:78: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-loader.h:80: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-loader.h:87: error: syntax
error before "GError"
/usr/local/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-loader.h:91: error: syntax
error before "GError"
In file included from /usr/local/include/glib-2.0/glib/gquark.h:30,
from /usr/local/include/glib-2.0/glib/gerror.h:24,
from /usr/local/include/glib-2.0/glib/gspawn.h:24,
from /usr/local/include/gtk-2.0/gdk/gdkspawn.h:26,
from /usr/local/include/gtk-2.0/gdk/gdk.h:52,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/glib-2.0/glib/gtypes.h:391: error: redefinition of `struct
_GTimeVal'
In file included from /usr/local/include/glib-2.0/glib/gerror.h:24,
from /usr/local/include/glib-2.0/glib/gspawn.h:24,
from /usr/local/include/gtk-2.0/gdk/gdkspawn.h:26,
from /usr/local/include/gtk-2.0/gdk/gdk.h:52,
from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/glib-2.0/glib/gquark.h:41: error: conflicting types for
`g_quark_to_string'
/usr/local/include/glib-1.2/glib.h:1784: error: previous declaration of
`g_quark_to_string'
In file included from /usr/local/include/gtk-2.0/gtk/gtk.h:31,
from base.c:1:
/usr/local/include/gtk-2.0/gdk/gdk.h:69: error: syntax error before '*' token
In file included from /usr/local/include/atk-1.0/atk/atkeditabletext.h:24,
from /usr/local/include/atk-1.0/atk/atk.h:27,
from /usr/local/include/gtk-2.0/gtk/gtkaccessible.h:23,
from /usr/local/include/gtk-2.0/gtk/gtk.h:36,
from base.c:1:
/usr/local/include/atk-1.0/atk/atktext.h:209: error: syntax error before
"gunichar"
/usr/local/include/atk-1.0/atk/atktext.h:293: error: syntax error before
"atk_text_get_character_at_offset"
In file included from /usr/local/include/gtk-2.0/gtk/gtkselection.h:34,
from /usr/local/include/gtk-2.0/gtk/gtkclipboard.h:25,
from /usr/local/include/gtk-2.0/gtk/gtk.h:62,
from base.c:1:
/usr/local/include/gtk-2.0/gtk/gtktextiter.h:104: error: syntax error before
"gtk_text_iter_get_char"
/usr/local/include/gtk-2.0/gtk/gtktextiter.h:258: error: syntax error before
"ch"
In file included from /usr/local/include/gtk-2.0/gtk/gtktreeview.h:27,
from /usr/local/include/gtk-2.0/gtk/gtkcombobox.h:25,
from /usr/local/include/gtk-2.0/gtk/gtk.h:68,
from base.c:1:
/usr/local/include/gtk-2.0/gtk/gtkentry.h:107: error: syntax error before
"gunichar"
/usr/local/include/gtk-2.0/gtk/gtkentry.h:150: error: syntax error before
"gunichar"
/usr/local/include/gtk-2.0/gtk/gtkentry.h:151: error: syntax error before
"gtk_entry_get_invisible_char"
In file included from /usr/local/include/gtk-2.0/gtk/gtk.h:106,
from base.c:1:
/usr/local/include/gtk-2.0/gtk/gtkimcontextsimple.h:49: error: syntax error
before "gunichar"
In file included from /usr/local/include/gtk-2.0/gtk/gtk.h:118,
from base.c:1:
/usr/local/include/gtk-2.0/gtk/gtkmain.h:99: error: syntax error before
"GOptionEntry"
/usr/local/include/gtk-2.0/gtk/gtkmain.h:103: error: syntax error before '*'
token
#v-
--
pozdrawiam / regards
Zbigniew Baniewski