On Tue, 4 Mar 2014, Hélio Guilherme wrote:
Here's the relevant test (assuming a standard GTK installation under /usr):Sorry but I am not still convinced about the dependency. I did not
installed (don't remember if I did) new required lib. And the code is
working (gdk_pixbuf_new_from_file exists already).
Here is one example where I load the SVG from file:
[helio@centos64 gretl]$ cvs diff gui2/gretl.c
RCS file: /cvsroot/gretl/./gretl/gui2/gretl.c,v
retrieving revision 1.809
diff -r1.809 gretl.c
GError *tmp_error = NULL;
/* VERIFY if OK to use / when using Windows */
icon = gdk_pixbuf_new_from_file((const char *) tmpfname, &tmp_error);
fprintf(stderr, "Error creating icon: %s\n", tmp_error->message);
I tried to use ldd to see the libs but it only works with dynamic libs and
ldd /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so \
| grep rsvg
When you call gdk_pixbuf_new_from_file(), the gdk_pixbuf library determines which dynamic module it needs to handle the task, and attempts to load it. In this case it's the svg module that's needed, and I'm betting that libpixbufloader-svg.so is linked to librsvg.
If librsvg were not present on the system then the svg module would fail to load and gdk_pixbuf couldn't handle the image file.
Gretl-devel mailing list