OK,

I did find a 32bit lib here (no 64bit), so I guess that is the one being called.

[helio@centos64 ~]$ ldd /usr/lib/gtk-2.0/2.10.0/loaders/svg_loader.so | grep rsvg
    librsvg-2.so.2 => /usr/lib/librsvg-2.so.2 (0x0051f000)


Thanks,
Hélio



On Tue, Mar 4, 2014 at 6:28 PM, Allin Cottrell <cottrell@wfu.edu> wrote:
On Tue, 4 Mar 2014, Hélio Guilherme wrote:

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
Index: gui2/gretl.c
===================================================================
RCS file: /cvsroot/gretl/./gretl/gui2/gretl.c,v
retrieving revision 1.809
diff -r1.809 gretl.c
55a56
#ifndef USE_SVG
56a58
#endif
2294a2297,2308
#ifdef USE_SVG
    GdkPixbuf *icon;
    GError *tmp_error = NULL;
    char tmpfname[MAXLEN];

/* VERIFY if OK to use / when using Windows */
    sprintf(tmpfname,"%svectorimages/%s",gretl_home(), "gretl.svg");
    icon = gdk_pixbuf_new_from_file((const char *) tmpfname, &tmp_error);
    if(tmp_error!=NULL) {
        fprintf(stderr, "Error creating icon: %s\n", tmp_error->message);
    }
#else
2295a2310,2311
#endif


I tried to use ldd to see the libs but it only works with dynamic libs and
not executables.

Here's the relevant test (assuming a standard GTK installation under /usr):

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.

Allin

_______________________________________________
Gretl-devel mailing list
Gretl-devel@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel