Linker error with gdk_pixbuf_xlib_get_from_drawable

269 views Asked by At

If I attempt to use the function gdk_pixbuf_xlib_get_from_drawable, it results in the following linker error:

undefined reference to gdk_pixbuf_xlib_get_from_drawable

I am compiling it using the gtk+-2.0 and libwnck-1.0 pkg-config options, like this:

... `pkg-config gtk+-2.0 libwnck-1.0 --cflags --libs`

I have also tried adding gdk-2.0 and x11 to the pkg-config options, but it still did not work.

My code looks roughly like this:

wnck_window_get_geometry (window, &xp, &yp, &widthp, &heightp);
pixbuf = gdk_pixbuf_xlib_get_from_drawable (pixbuf, gdk_window,
    NULL, NULL, 0, 0, 0, 0, widthp, heightp);
1

There are 1 answers

2
Ross Burton On BEST ANSWER

You need to add gdk-pixbuf-xlib-2.0 to your pkg-config checks, and include gdk-pixbuf-xlib.h.