tags:

views:

19

answers:

1

Hello,

I have a code for loading data:

GFileInputStream* ins;
GFile* gf = g_file_new_for_path(file_path);
ins = g_file_read(gf, NULL, NULL);

mw->pix = gdk_pixbuf_new_from_stream(G_INPUT_STREAM(ins), NULL, NULL);
gtk_image_view_set_pixbuf (GTK_IMAGE_VIEW (mw->view), mw->pix, TRUE);
g_input_stream_close(G_INPUT_STREAM(ins), NULL, NULL);

When i try to run app i see error: symbol lookup error: undefined symbol: gdk_pixbuf_new_from_stream

What's wrong?

Thank you

+2  A: 

When you use some symbol you should link against the library containing that symbol, -lgdk_pixbuf-2.0 (or better $(pkg-config --libs gdk-pixbuf-2.0) in the case of gdk_pixbuf_new_from_stream.

wRAR
Thank you for reply.I have -lgdk_pixbuf-2.0 in my makefile, but it's not help.
shk
I have in my makefile: GTK_LIBS = -L/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lgtkimageview -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lz -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
shk
Double-check your actual link command.
wRAR