This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gtk application compile error


"Raheel" <raheel dot khan at hotpop dot com> writes:

> hi .........
> 
> I have written a very basic program using gtk_widgets. And tried the command
> line switches. Below is what i got when try to compile: #  gcc -Wall
> wind.c -o wind.o 'gtk-config --libs --cflags'

You are using the wrong kind of quotes. Try:

gcc -Wall wind.c -o wind.o `gtk-config --libs --cflags`

The ` (backquote) key is usually near the upper left hand corney of
    the keyboard, but I haven't seen a Sun keyboard in years...

> 
> > gcc: gtk-config --libs --cflags: No such file or directory
> > wind.c:2:21: gtk/gtk.h: No such file or directory
> > wind.c: In function `main':
> > wind.c:7: `GtkWidget' undeclared (first use in this function)
> > wind.c:7: (Each undeclared identifier is reported only once
> > wind.c:7: for each function it appears in.)
> > wind.c:7: `window' undeclared (first use in this function)
> > wind.c:9: warning: implicit declaration of function `gtk_init'
> > wind.c:11: warning: implicit declaration of function `gtk_window_new'
> > wind.c:11: `GTK_WINDOW_TOPLEVEL' undeclared (first use in this function)
> > wind.c:12: warning: implicit declaration of function `gtk_widget_show'
> > wind.c:14: warning: implicit declaration of function `gtk_main'
> 
> plz help me, I am hanging between all this.
> 
> Raheel.
> 
> plz note my source code is:
> 
> 
> # include <gtk/gtk.h>
> 
> int main( int   argc, char *argv[] )
> {
> 
>     GtkWidget *window;
> 
>     gtk_init (&argc, &argv);
> 
>     window =3D gtk_window_new (GTK_WINDOW_TOPLEVEL);
>     gtk_widget_show  (window);
> 
>     gtk_main ();
> 
>   //printf ("this is first gcc program\n");
>   //printf ("%s", argv[1]);
>   //printf ("%s", argv[2]);
> 
>     return 0;
> }
> 
> AND  my development box is solaris 8.0 (sparc).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]