Home > GTK+ > GTK+ 2.5.1 released GTK+ 2.5.1 released Eugenia Loli 2004-08-02 GTK+ 9 Comments Red Hat’s Matthias Clasen released GTK+ 2.5.1 and GLib 2.5.1 for testing. About The Author Eugenia Loli Ex-programmer, ex-editor in chief at OSNews.com, now a visual artist/filmmaker. Follow me on Twitter @EugeniaLoli 9 Comments 2004-08-02 4:38 pm Anonymous I put “gtk tutorial” into Google (with or without the quotes, I don’t remember) and got the sec-scribble.html page. It’s a silly little paint program that I wanted to turn into a nice console font editor. gcc -W -O2 -Wall -s `gtk-config –libs –cflags` simple.c That should do it, right? Nope. It won’t work with either gtk-1.2 or gtk-2.0 libraries. Given that this is a tutorial, and should not be relying on advanced features, I think that it shouldn’t matter what gtk I have. Supposing that’s the problem though, gtk is clearly way too volatile to rely on. 2004-08-02 5:08 pm Anonymous Maybe you didn’t install the headers? Do some investigation before you flame something down. It may very well be your own fault since it does work for everybody else. 2004-08-02 5:10 pm Anonymous In the Linux world, NEVER expect things to be compatible. Luckely, often things are. But stuff breaks too damn often. 2004-08-02 5:15 pm Anonymous I can say the same thing about any operating system, including Windows. Don’t believe me? Write an app that uses GetWindowModuleFileName() and see how it acts differently on Win9x and NT/XP! 2004-08-02 6:22 pm Anonymous cant seem to get Pango to return a good version number.. ./configure make make install then go to get gtk configured and i get checking for glib-2.0 >= 2.4.0 atk >= 1.0.1 pango >= 1.5.1… Requested ‘pango >= 1.5.1’ but version of Pango is 1.4.0 :: shrugs :: anyone know a little fix to this? (note: im still a linux novice.) 2004-08-02 7:40 pm Anonymous Of course the headers are installed. I’m hitting problems on both… 1. my own box, running Debian-woody on ppc 2. the SuSE AMD64 box on the SourceForge compile farm Using GTK 2 (via gtk-config into sed, ugh) the AMD64 box gives errors starting with: ———————— In file included from /usr/include/gtk-2.0/gdk/gdkcolor.h:4, from /usr/include/gtk-2.0/gdk/gdk.h:30, from /usr/include/gtk-2.0/gtk/gtk.h:31, from simple.c:21: /usr/include/gtk-2.0/gdk/gdktypes.h:33:25: pango/pango.h: No such file or directory /usr/include/gtk-2.0/gdk/gdktypes.h:34:25: glib-object.h: No such file or directory /usr/include/gtk-2.0/gdk/gdktypes.h:51:23: gdkconfig.h: No such file or directory In file included from /usr/include/gtk-2.0/gdk/gdk.h:30, from /usr/include/gtk-2.0/gtk/gtk.h:31, from simple.c:21: /usr/include/gtk-2.0/gdk/gdkcolor.h:41: parse error before “GObject” /usr/include/gtk-2.0/gdk/gdkcolor.h:41: warning: no semicolon at end of struct or union /usr/include/gtk-2.0/gdk/gdkcolor.h:51: parse error before ‘}’ token /usr/include/gtk-2.0/gdk/gdkcolor.h:55: parse error before “GObjectClass” /usr/include/gtk-2.0/gdk/gdkcolor.h:55: warning: no semicolon at end of struct or union /usr/include/gtk-2.0/gdk/gdkcolor.h:59: parse error before “gdk_colormap_get_type” —————— Using GTK 1.2, the Debian errors start with: ———————— simple.c: In function `configure_event’: simple.c:31: warning: implicit declaration of function `g_object_unref’ simple.c:28: warning: unused parameter `event’ simple.c: In function `expose_event’: simple.c:51: warning: implicit declaration of function `gdk_draw_drawable’ simple.c: In function `main’: simple.c:135: warning: implicit declaration of function `g_signal_connect’ simple.c:135: warning: implicit declaration of function `G_OBJECT’ simple.c:136: warning: implicit declaration of function `G_CALLBACK’ simple.c:141: warning: implicit declaration of function `gtk_widget_set_size_request’ simple.c:170: warning: implicit declaration of function `g_signal_connect_swapped’ /tmp/cc3l5kmV.o(.text+0x80): In function `configure_event’: : undefined reference to `g_object_unref’ /tmp/cc3l5kmV.o(.text+0x80): In function `configure_event’: : relocation truncated to fit: R_PPC_REL24 g_object_unref /tmp/cc3l5kmV.o(.text+0xf8): In function `expose_event’: : undefined reference to `gdk_draw_drawable’ /tmp/cc3l5kmV.o(.text+0xf8): In function `expose_event’: : relocation truncated to fit: R_PPC_REL24 gdk_draw_drawable /tmp/cc3l5kmV.o(.text+0x3c4): In function `main’: : undefined reference to `G_OBJECT’ ————————- 2004-08-02 10:23 pm Anonymous http://www.gtk.org/~otaylor/gtk/tutorial/scribble-simple.c works just fine here: gebner@schnecke2 ~/tmp/scribble-simple [0] $ gcc -o scribble-simple `gtk-config –libs –cflags` scribble-simple.c gebner@schnecke2 ~/tmp/scribble-simple [0] $ 2004-08-02 11:20 pm Anonymous Excellent. That one even works with the gtk-1.2 library! The tutorial that Google returns, on that very same gtk.org site, is no good: http://www.gtk.org/tutorial/sec-scribble.html (tried with both gtk-1.2 and gtk-2.0) Perhaps that one needs to be deleted? 2004-08-03 11:47 am Anonymous Without even trying the tutorial (cannot do that since I’m not at home now) I can tell you that you’re lucky if it compiles with gtk-config since that is a gtk-1.x utility no longer used. The way to compile GTK2 programs is by using pkg-config: $ gcc `pkg-config gtk+2.0 –libs –cflags` myprog.c -o myprog Don’t remember the exact name for “gtk+2.0” above, it may be something different (but similar). Use “pkg-config –list-all | grep -i gtk” to find out
I put “gtk tutorial” into Google (with or without the quotes,
I don’t remember) and got the sec-scribble.html page. It’s a
silly little paint program that I wanted to turn into a
nice console font editor.
gcc -W -O2 -Wall -s `gtk-config –libs –cflags` simple.c
That should do it, right? Nope. It won’t work with either
gtk-1.2 or gtk-2.0 libraries. Given that this is a tutorial,
and should not be relying on advanced features, I think that
it shouldn’t matter what gtk I have.
Supposing that’s the problem though, gtk is clearly way
too volatile to rely on.
Maybe you didn’t install the headers?
Do some investigation before you flame something down. It may very well be your own fault since it does work for everybody else.
In the Linux world, NEVER expect things to be compatible.
Luckely, often things are. But stuff breaks too damn often.
I can say the same thing about any operating system, including Windows.
Don’t believe me? Write an app that uses GetWindowModuleFileName() and see how it acts differently on Win9x and NT/XP!
cant seem to get Pango to return a good version number..
./configure
make
make install
then go to get gtk configured and i get
checking for glib-2.0 >= 2.4.0 atk >= 1.0.1 pango >= 1.5.1… Requested ‘pango >= 1.5.1’ but version of Pango is 1.4.0
:: shrugs :: anyone know a little fix to this? (note: im still a linux novice.)
Of course the headers are installed. I’m hitting
problems on both…
1. my own box, running Debian-woody on ppc
2. the SuSE AMD64 box on the SourceForge compile farm
Using GTK 2 (via gtk-config into sed, ugh) the AMD64 box
gives errors starting with:
————————
In file included from /usr/include/gtk-2.0/gdk/gdkcolor.h:4,
from /usr/include/gtk-2.0/gdk/gdk.h:30,
from /usr/include/gtk-2.0/gtk/gtk.h:31,
from simple.c:21:
/usr/include/gtk-2.0/gdk/gdktypes.h:33:25: pango/pango.h: No such file or directory
/usr/include/gtk-2.0/gdk/gdktypes.h:34:25: glib-object.h: No such file or directory
/usr/include/gtk-2.0/gdk/gdktypes.h:51:23: gdkconfig.h: No such file or directory
In file included from /usr/include/gtk-2.0/gdk/gdk.h:30,
from /usr/include/gtk-2.0/gtk/gtk.h:31,
from simple.c:21:
/usr/include/gtk-2.0/gdk/gdkcolor.h:41: parse error before “GObject”
/usr/include/gtk-2.0/gdk/gdkcolor.h:41: warning: no semicolon at end of struct or union
/usr/include/gtk-2.0/gdk/gdkcolor.h:51: parse error before ‘}’ token
/usr/include/gtk-2.0/gdk/gdkcolor.h:55: parse error before “GObjectClass”
/usr/include/gtk-2.0/gdk/gdkcolor.h:55: warning: no semicolon at end of struct or union
/usr/include/gtk-2.0/gdk/gdkcolor.h:59: parse error before “gdk_colormap_get_type”
——————
Using GTK 1.2, the Debian errors start with:
————————
simple.c: In function `configure_event’:
simple.c:31: warning: implicit declaration of function `g_object_unref’
simple.c:28: warning: unused parameter `event’
simple.c: In function `expose_event’:
simple.c:51: warning: implicit declaration of function `gdk_draw_drawable’
simple.c: In function `main’:
simple.c:135: warning: implicit declaration of function `g_signal_connect’
simple.c:135: warning: implicit declaration of function `G_OBJECT’
simple.c:136: warning: implicit declaration of function `G_CALLBACK’
simple.c:141: warning: implicit declaration of function `gtk_widget_set_size_request’
simple.c:170: warning: implicit declaration of function `g_signal_connect_swapped’
/tmp/cc3l5kmV.o(.text+0x80): In function `configure_event’:
: undefined reference to `g_object_unref’
/tmp/cc3l5kmV.o(.text+0x80): In function `configure_event’:
: relocation truncated to fit: R_PPC_REL24 g_object_unref
/tmp/cc3l5kmV.o(.text+0xf8): In function `expose_event’:
: undefined reference to `gdk_draw_drawable’
/tmp/cc3l5kmV.o(.text+0xf8): In function `expose_event’:
: relocation truncated to fit: R_PPC_REL24 gdk_draw_drawable
/tmp/cc3l5kmV.o(.text+0x3c4): In function `main’:
: undefined reference to `G_OBJECT’
————————-
http://www.gtk.org/~otaylor/gtk/tutorial/scribble-simple.c works just fine here:
gebner@schnecke2 ~/tmp/scribble-simple [0] $ gcc -o scribble-simple `gtk-config –libs –cflags` scribble-simple.c
gebner@schnecke2 ~/tmp/scribble-simple [0] $
Excellent. That one even works with the gtk-1.2 library!
The tutorial that Google returns, on that very
same gtk.org site, is no good:
http://www.gtk.org/tutorial/sec-scribble.html
(tried with both gtk-1.2 and gtk-2.0)
Perhaps that one needs to be deleted?
Without even trying the tutorial (cannot do that since I’m not at home now) I can tell you that you’re lucky if it compiles with gtk-config since that is a gtk-1.x utility no longer used.
The way to compile GTK2 programs is by using pkg-config:
$ gcc `pkg-config gtk+2.0 –libs –cflags` myprog.c -o myprog
Don’t remember the exact name for “gtk+2.0” above, it may be something different (but similar). Use “pkg-config –list-all | grep -i gtk” to find out