Re: gdk (glib?) error



just add

error = NULL;

and you should be fine.

todd

Hi there!

I got a little problem here with gdk, creating a GdkPixbuf * from 
file. I used this code to create these GdkPixbuf (gtk/gtk.h is 
#included):

  GdkPixbuf *icon;
  GError *error;

  icon = gdk_pixbuf_new_from_file ("test.png", &error);
  if (icon == NULL)
    printf ("%s\n", error->message);
  else
    printf ("No error!\n");

When run the compiled program, the output is like this:

  simlan black:/data/dev/pixbuf-tests$ ./simfm 

  (process:2044): GLib-GObject-CRITICAL **:
gtype.c:1806:g_type_register_static(): initialization assertion 
failed, use g_type_init() prior to this function

  (process:2044): GLib-GObject-CRITICAL **: file gobject.c: line 585
(g_object_new): assertion `G_TYPE_IS_OBJECT (object_type)' failed
  Segmentation fault
  simlan black:/data/dev/pixbuf-tests$ 

What is wrong?






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