GdkPixbuf-WARNING:cannot open pixbuf loader module file(on Windows)



Hi,everyone.

I want to write a program to display an image.
This is my code:

/#include <gtk/gtk.h>

int main(int argc,char **argv){

   gtk_init(&argc,&argv);

   GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   GtkWidget *image = gtk_image_new_from_file("wxp.jpg");

   gtk_container_add(GTK_CONTAINER(window),image);
   gtk_window_resize(GTK_WINDOW(window),300,300);
   gtk_widget_show_all(window);

   gtk_main();

   return 0;

}
/

But after I ran the program, it only display a broken image icon.

/wxp.jpg is at the same directory as my program,and this is the error message: (gtk_image.exe:1100): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file 'C:\WINDOWS\system32\etc\gtk-2.0\gdk-pixbuf.loaders': No such file or directory

(gtk_image.exe:1100): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file 'C:\WINDOWS\system32\etc\gtk-2.0\gdk-pixbuf.loaders': No such file or directory

(gtk_image.exe:1100): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file 'C:\WINDOWS\system32\etc\gtk-2.0\gdk-pixbuf.loaders': No such file or directory/

What should I do to display my image(wxp.jpg)?

Any suggestion is appreciated.


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