Re: need help with GTK+2.0



Le mercredi 15 d�mbre 2004 �3:02 -0500, Bivek Agrawal a �it :
> Hi all,
> 
> I have this tiny tiny program, which (1) when compiled as ....
> 
> $> gcc -Wall -g example.c -o example `pkg-config --cflags --libs
> gtk+-2.0` -lgtk-x11-2.0 -lgdk-x11-2.0
> 
> ... compile well and then (2) when run, generates bus error at
> 
>          window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
> 
> (3) the same program works if GTK+1.2 is used instead of GTK+2.0
> 
> note : Running on Sun Solaris
> ------- example.c ----------
> #include <gtk-2.0/gtk/gtk.h>
> int main( int   argc, char *argv[] )
> {
>   GtkWidget *window;
> 
>   gtk_init (&argc, &argv);
> 
>   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
>   gtk_container_set_border_width (GTK_CONTAINER (window), 10);
>   g_print ("Hello World\n");
> 
>   gtk_widget_show (window);
>   gtk_main ();
>   return 0;
> }
> 
> 
> 
> 
> Thank you
> Bek

Why do you add "-lgtk-x11-2.0 -lgdk-x11-2.0". pkg-config should do it
for you (it does on my machine). Otherwise, this is quite strange, it
should work.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]