Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a gtk program in which I am trying to call a gdk function. I have the following include files:

#include <gtk/gtk.h>
#include <gdk/gdk.h>

and am compiling with the following:

gcc `pkg-config --cflags --libs gtk+-2.0 cairo glib-2.0 gdk-2.0` gtk_fixed.c Widget.c Node.c Line.c

I am getting the following error:

undefined reference to `gdk_device_ungrab'

Can anyone point me in the right direction as to how to fix this? Thanks.

share|improve this question
up vote 1 down vote accepted

Looking at this link

There is no grab method in Gdk 2.

There is a grab method in Gdk 3,though.

Did you read the docs for Gdk 3?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.