Search code examples
cgtkgdk

GDK function not found


I have a gtk program in which I am calling a gdk function. I am compiling the program using:

 gcc `pkg-config --cflags --libs gtk+-2.0 cairo glib-2.0` ...

and I have included

#include <gdk/gdk.h>

it gives me the error:

undefined reference to `gdk_device_ungrab'

Does anyone know what I am doing wrong?


Solution

  • You are compiling and linking against gtk 2.x and gdk_device_ungrab is available only starting from gtk 3.0.

    See: http://developer.gnome.org/gdk3/3.4/GdkDevice.html#gdk-device-ungrab