Topic: Error compiling with gtk2

Hello, I have downloaded the source package and tried to compile it with GTK-version 2. There I get 2 errors:
widgets.c:99: error: ‘GDK_KEY_space’ undeclared (first use in this function)
widgets.c:101: error: ‘GDK_KEY_BackSpace’ undeclared (first use in this function)

Changing the names to the GDK_space and GDK_BackSpace solves the problem. The names GDK_KEY_space and GDK_KEY_BackSpace are only valid on GTK-version 3.

best regards and thanx for the prog

blackbeer

Thumbs up Thumbs down

Re: Error compiling with gtk2

Hi, and thanks for the feedback!

It's strange because for me both of the keys seem to work in GTK+ 2.24. They are defined in /usr/include/gtk-2.0/gdk/gdkkeysyms.c:

#define GDK_KEY_BackSpace 0xff08
#define GDK_KEY_space 0x020

Maybe I'm missing something? Although what could be different on our systems? The GTK version maybe?

Overhead the albatross hangs motionless upon the air...

3 (edited by blackbeer 2011-09-30 07:51:40)

Re: Error compiling with gtk2

Hi,

I'm using Debian 6.02 which installs GTK+ 2.20. Maybe this is important difference...

Edit: The GDK_KEY_xxx defines are valid for GTK+ 2.22 and up. You could implement something like

#ifndef GDK_KEY_space
#define GDK_KEY_space GDK_space
#endif

or

#if ! GTK_CHECK_VERSION (2, 22, 0)
...
#endif

blackbeer

Thumbs up Thumbs down

Re: Error compiling with gtk2

Well that clears it. I'll try to fix it for the next version, thanks for this. Actually it's quite a big chance to make a transition to GTK 3 for the next version, but we'll see.

Overhead the albatross hangs motionless upon the air...