Re: Graphical C programming with GTK 2.0

2004-12-10 Thread Bob Van Zant
The attachments prove that the .pc file is installed, however, not where
pkg_config is looking. A workaround for this is to set the
PKG_CONFIG_PATH environment variable. See pkg-config(1).

The second attachment you gave, with the very small number of errors
looks to me like you've got a missing semi-colon or similar in your
main.c file (the "early" line number could also hint at a munged
#include). But this second run you gave shows that the problem you're
having is no longer with gtk/glib/pango but with your own code.

So either set the environment variable I mentioned above (consider a
makefile) or continue using the path to the .pc file that you've shown
to work and start debugging your app.

-Bob

On Fri, 2004-12-10 at 22:38 +, Frank Staals wrote:
> Bob Van Zant wrote:
> 
> >The output you pasted below used single quotes instead of backticks for
> >the pkg_config portion of the argument. Single quote: ', backtick `.
> >
> >I'm not sure why you used single quotes there, because your examples in
> >your email used backticks.
> >
> >Also, it looks like you're missing some of the glib and pango libraries.
> >However, once you get your pkg_config part working right the include
> >directories might get set right and it might actually compile. Good
> >luck.
> >
> >-Bob
> >
> >  
> >
> Hmm I copied the examples into this e-mail, but when I use ` statements 
> I get error_gtk2.txt (attachment ) then I tried to compile it like this: 
> gcc mainwindow.c -o mainwindow -I/usr/X11R6/include/gtk-2.0/ `pkg-config 
> --cflags --libs /usr/X11R6/libdata/pkgconfig/gtk+-2.0.pc` That gave 
> error_gtk3.txt ( attachment )
> 
> What do I have to do to compile it correct ?
> 
> ===
>This footer was appended by the Honeypot Injector
>The message was injected from 216.136.204.119
>on 10 Dec 2004 13:39:14 -0800.  This IP
>was classified in the WHITELIST sender group.
>The org ID is 1681939, and the SBRS is 2.1
> ===
> plain text document attachment (error_gtk2.txt)
> bash-3.00$ gcc mainwindow.c -o mainwindow -I/usr/X11R6/include/gtk-2.0/ 
> `pkg-config --cflags --libs gtk+2.0`
> gnome-config: not found
> Package gtk+2.0 was not found in the pkg-config search path.
> Perhaps you should add the directory containing `gtk+2.0.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'gtk+2.0' found
> In file included from /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:4,
>  from /usr/X11R6/include/gtk-2.0/gdk/gdk.h:30,
>  from /usr/X11R6/include/gtk-2.0/gtk/gtk.h:31,
>  from mainwindow.c:1:
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:32:18: glib.h: No such file or 
> directory
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:33:25: pango/pango.h: No such file 
> or directory
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:34:25: glib-object.h: No such file 
> or directory
> In file included from /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:4,
>  from /usr/X11R6/include/gtk-2.0/gdk/gdk.h:30,
>  from /usr/X11R6/include/gtk-2.0/gtk/gtk.h:31,
>  from mainwindow.c:1:
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:76: error: syntax error before 
> "GdkWChar"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:76: warning: data definition has no 
> type or storage class
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:89: error: syntax error before 
> "GdkNativeWindow"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:89: warning: data definition has no 
> type or storage class
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:170: error: syntax error before 
> "data"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:174: error: syntax error before 
> "data"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:178: error: syntax error before 
> "gint"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:184: error: syntax error before 
> "gint"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:192: error: syntax error before 
> "gint"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:200: error: syntax error before 
> "gint"
> In file included from /usr/X11R6/include/gtk-2.0/gdk/gdk.h:30,
>  from /usr/X11R6/include/gtk-2.0/gtk/gtk.h:31,
>  from mainwindow.c:1:
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:19: error: syntax error before 
> "guint32"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:41: error: syntax error before 
> "GObject"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:50: error: syntax error before 
> "gpointer"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:55: error: syntax error before 
> "GObjectClass"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:59: error: syntax error before 
> "gdk_colormap_get_type"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:59: error: syntax error before 
> "G_GNUC_CONST"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:59: warning: data definition has no 
> type or storage class
> /usr/X11R6/i

Re: Graphical C programming with GTK 2.0

2004-12-10 Thread Frank Staals
Bob Van Zant wrote:
The output you pasted below used single quotes instead of backticks for
the pkg_config portion of the argument. Single quote: ', backtick `.
I'm not sure why you used single quotes there, because your examples in
your email used backticks.
Also, it looks like you're missing some of the glib and pango libraries.
However, once you get your pkg_config part working right the include
directories might get set right and it might actually compile. Good
luck.
-Bob
 

Hmm I copied the examples into this e-mail, but when I use ` statements 
I get error_gtk2.txt (attachment ) then I tried to compile it like this: 
gcc mainwindow.c -o mainwindow -I/usr/X11R6/include/gtk-2.0/ `pkg-config 
--cflags --libs /usr/X11R6/libdata/pkgconfig/gtk+-2.0.pc` That gave 
error_gtk3.txt ( attachment )

What do I have to do to compile it correct ?
bash-3.00$ gcc mainwindow.c -o mainwindow -I/usr/X11R6/include/gtk-2.0/ 
`pkg-config --cflags --libs gtk+2.0`
gnome-config: not found
Package gtk+2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+2.0' found
In file included from /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:4,
 from /usr/X11R6/include/gtk-2.0/gdk/gdk.h:30,
 from /usr/X11R6/include/gtk-2.0/gtk/gtk.h:31,
 from mainwindow.c:1:
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:32:18: glib.h: No such file or 
directory
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:33:25: pango/pango.h: No such file or 
directory
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:34:25: glib-object.h: No such file or 
directory
In file included from /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:4,
 from /usr/X11R6/include/gtk-2.0/gdk/gdk.h:30,
 from /usr/X11R6/include/gtk-2.0/gtk/gtk.h:31,
 from mainwindow.c:1:
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:76: error: syntax error before 
"GdkWChar"
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:76: warning: data definition has no 
type or storage class
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:89: error: syntax error before 
"GdkNativeWindow"
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:89: warning: data definition has no 
type or storage class
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:170: error: syntax error before "data"
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:174: error: syntax error before "data"
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:178: error: syntax error before "gint"
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:184: error: syntax error before "gint"
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:192: error: syntax error before "gint"
/usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:200: error: syntax error before "gint"
In file included from /usr/X11R6/include/gtk-2.0/gdk/gdk.h:30,
 from /usr/X11R6/include/gtk-2.0/gtk/gtk.h:31,
 from mainwindow.c:1:
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:19: error: syntax error before 
"guint32"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:41: error: syntax error before 
"GObject"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:50: error: syntax error before 
"gpointer"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:55: error: syntax error before 
"GObjectClass"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:59: error: syntax error before 
"gdk_colormap_get_type"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:59: error: syntax error before 
"G_GNUC_CONST"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:59: warning: data definition has no 
type or storage class
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:62: error: syntax error before 
"gboolean"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:76: error: syntax error before 
"gdk_colormap_get_system_size"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:76: warning: data definition has no 
type or storage class
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:82: error: syntax error before "gint"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:85: error: syntax error before 
"gdk_colormap_alloc_colors"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:87: error: syntax error before "gint"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:90: warning: data definition has no 
type or storage class
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:91: error: syntax error before 
"gdk_colormap_alloc_color"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:93: error: syntax error before 
"gboolean"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:94: warning: data definition has no 
type or storage class
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:97: error: syntax error before "gint"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:99: error: syntax error before 
"gulong"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:106: error: syntax error before 
"gdk_color_parse"
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:106: error: syntax error before '*' 
token
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:107: warning: data definition has no 
type or storage class
/usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:108: erro

Re: Graphical C programming with GTK 2.0

2004-12-10 Thread Miguel Mendez
On Fri, 10 Dec 2004 19:48:08 +
Frank Staals <[EMAIL PROTECTED]> wrote:

> I would like to build graphical C programs, therefor I wanted to use 
> GTK. I tried to build the first program in the GTK Tutorial: 
> http://www.gtk.org/tutorial/ch-gettingstarted.html and I tried to 
> compile it as it was explained there: gcc mainwindow.c -o mainwindow 
> `pkg-config --cflags --libs gtk+-2.0`  I couldn't compile it because
> of 

Looking at the log it seems like you didn't use backquotes, so the shell
didn't expand the pkg-config command. Note that ' and ` have different
meanings.

Once you get past that I'd recommend you looking at libglade2, which is
almost essential as soon as you start writing programs with non-trivial
GUIs.

Cheers,
-- 
Miguel Mendez <[EMAIL PROTECTED]> | lea gfx_lib(pc),a1
http://www.energyhq.es.eu.org| moveq   #0,d0
PGP Key: 0xDC8514F1  | move.l  4.w,a6
Note: All HTML mail goes to /dev/null| jsr -552(a6)



pgpJwf43tzBfu.pgp
Description: PGP signature


Re: Graphical C programming with GTK 2.0

2004-12-10 Thread Bob Van Zant
The output you pasted below used single quotes instead of backticks for
the pkg_config portion of the argument. Single quote: ', backtick `.

I'm not sure why you used single quotes there, because your examples in
your email used backticks.

Also, it looks like you're missing some of the glib and pango libraries.
However, once you get your pkg_config part working right the include
directories might get set right and it might actually compile. Good
luck.

-Bob

On Fri, 2004-12-10 at 19:48 +, Frank Staals wrote:
> I would like to build graphical C programs, therefor I wanted to use 
> GTK. I tried to build the first program in the GTK Tutorial: 
> http://www.gtk.org/tutorial/ch-gettingstarted.html and I tried to 
> compile it as it was explained there: gcc mainwindow.c -o mainwindow 
> `pkg-config --cflags --libs gtk+-2.0`  I couldn't compile it because of 
> it couldn't find gtk.h, so I used this: gcc mainwindow.c -o mainwindow 
> -I/usr/X11R6/incluse/gtk-2.0/ `pkg-config --cflags --libs gtk+-2.0` but 
> it still doesn't work, the first lines of the error are inlcuded with 
> this e-mail.
> 
> I hope someone can tell me what to do so I can compile my program
> 
> Frank Staals
> 
> 
> 
> ===
>This footer was appended by the Honeypot Injector
>The message was injected from 216.136.204.119
>on 10 Dec 2004 10:48:38 -0800.  This IP
>was classified in the  sender group.
>The org ID is 1681939, and the SBRS is 2.1
> ===
> plain text document attachment (error_gtk.txt)
> bash-3.00$ gcc mainwindow.c -o mainwindow -I/usr/X11R6/include/gtk-2.0/ 
> 'pkg-config --cflags --libs gtk+-2.0'
> gcc: pkg-config --cflags --libs gtk+-2.0: No such file or directory
> In file included from /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:4,
>  from /usr/X11R6/include/gtk-2.0/gdk/gdk.h:30,
>  from /usr/X11R6/include/gtk-2.0/gtk/gtk.h:31,
>  from mainwindow.c:1:
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:32:18: glib.h: No such file or 
> directory
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:33:25: pango/pango.h: No such file 
> or directory
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:34:25: glib-object.h: No such file 
> or directory
> In file included from /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:4,
>  from /usr/X11R6/include/gtk-2.0/gdk/gdk.h:30,
>  from /usr/X11R6/include/gtk-2.0/gtk/gtk.h:31,
>  from mainwindow.c:1:
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:76: error: syntax error before 
> "GdkWChar"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:76: warning: data definition has no 
> type or storage class
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:89: error: syntax error before 
> "GdkNativeWindow"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:89: warning: data definition has no 
> type or storage class
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:170: error: syntax error before 
> "data"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:174: error: syntax error before 
> "data"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:178: error: syntax error before 
> "gint"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:184: error: syntax error before 
> "gint"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:192: error: syntax error before 
> "gint"
> /usr/X11R6/include/gtk-2.0/gdk/gdktypes.h:200: error: syntax error before 
> "gint"
> In file included from /usr/X11R6/include/gtk-2.0/gdk/gdk.h:30,
>  from /usr/X11R6/include/gtk-2.0/gtk/gtk.h:31,
>  from mainwindow.c:1:
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:19: error: syntax error before 
> "guint32"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:41: error: syntax error before 
> "GObject"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:50: error: syntax error before 
> "gpointer"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:55: error: syntax error before 
> "GObjectClass"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:59: error: syntax error before 
> "gdk_colormap_get_type"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:59: error: syntax error before 
> "G_GNUC_CONST"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:59: warning: data definition has no 
> type or storage class
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:62: error: syntax error before 
> "gboolean"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:76: error: syntax error before 
> "gdk_colormap_get_system_size"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:76: warning: data definition has no 
> type or storage class
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:82: error: syntax error before 
> "gint"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:85: error: syntax error before 
> "gdk_colormap_alloc_colors"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:87: error: syntax error before 
> "gint"
> /usr/X11R6/include/gtk-2.0/gdk/gdkcolor.h:90: warning: data definition has no 
>