Help requested with building v2.6.8 gtk+2 on linux old system

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Post Reply
omero
Posts: 48
Joined: Fri Mar 31, 2023 10:43 am

Help requested with building v2.6.8 gtk+2 on linux old system

Post by omero »

Hello.
Been long time playing on v2.4.0 on my old system and decided to try out v2.6.8.
I used 'git clone -b R2_6_8 https://github.com/freeciv/freeciv freeciv-2.6.8' to get the source.

Running 'sh ./autogen.sh' goes smoothly, which will trigger configure without options (which also completes smoothly).
At this point, i did './configure --prefix=/home/omero/freeciv268 --enable-client=gtk2,sdl' and all apparently goes well, as indicated by the final summary one gets at the end.

However, the next 'make' steps proceeds past the 'sdl' stage but in the 'gtk2' stage, it terminates with:

Code: Select all

Making all in gui-gtk-2.0
make[2]: Entering directory `/home/omero/tmp/freeciv-2.6.8.2023-03-16+11:46:48/client/gui-gtk-2.0'
make  all-am
make[3]: Entering directory `/home/omero/tmp/freeciv-2.6.8.2023-03-16+11:46:48/client/gui-gtk-2.0'
  CC     gui_main.lo
gui_main.c: In function ‘key_press_map_canvas’:
gui_main.c:551: error: ‘GDK_KEY_plus’ undeclared (first use in this function)
gui_main.c:551: error: (Each undeclared identifier is reported only once
gui_main.c:551: error: for each function it appears in.)
gui_main.c:555: error: ‘GDK_KEY_minus’ undeclared (first use in this function)
At top level:
cc1: warning: unrecognized command line option "-Wno-nonnull-compare"
cc1: warning: unrecognized command line option "-Wno-tautological-compare"
make[3]: *** [gui_main.lo] Error 1
make[3]: Leaving directory `/home/omero/tmp/freeciv-2.6.8.2023-03-16+11:46:48/client/gui-gtk-2.0'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/omero/tmp/freeciv-2.6.8.2023-03-16+11:46:48/client/gui-gtk-2.0'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/omero/tmp/freeciv-2.6.8.2023-03-16+11:46:48/client'
make: *** [all-recursive] Error 1

According to 'configure', all version checks pass with flying colors. I have the logs but don't know how to attach them here.
Relevant part:

Code: Select all

checking for GTK+ - version >= 2.12.0... yes (version 2.18.5)
checking for GTHREAD_GTK2... yes
The sdl client does build/runs fine and i tried to play along with it but ... Long story short, it is lacking especially in the 'keyboard shortcuts' department (maybe will detail more in a separate post).

I need some help to understand which GTK+2 library provides those ‘GDK_KEY_plus’ and ‘GDK_KEY_minus’.

Please, pretty pretty please with sugar on top: help me get a GTK2 client running on my ancient system. Please :)
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Help requested with building v2.6.8 gtk+2 on linux old system

Post by cazfi »

Can you tell me what linux exactly you are trying this on? Maybe I can install it on a virtual machine to test (assuming it's still available somewhere)

Though you already told that gtk+ version is 2.18, so first step will be to confirm that 'GDK_KEY_plus’ and ‘GDK_KEY_minus' exist there. We may have added their use recently without realizing that they are not backward compatible enough on gtk+2.
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Help requested with building v2.6.8 gtk+2 on linux old system

Post by cazfi »

cazfi wrote: Fri Mar 31, 2023 11:54 amThough you already told that gtk+ version is 2.18, so first step will be to confirm that 'GDK_KEY_plus’ and ‘GDK_KEY_minus' exist there. We may have added their use recently without realizing that they are not backward compatible enough on gtk+2.
That seems to be the case. Those values have been added in gtk+-2.20.

Opened a ticket -> https://osdn.net/projects/freeciv/ticket/47728
omero
Posts: 48
Joined: Fri Mar 31, 2023 10:43 am

Re: Help requested with building v2.6.8 gtk+2 on linux old system

Post by omero »

My system is slightly unconventional, but was never meant to be a 'distribution'.
Still runs, thus...

Was puzzled by 'configure' not reacting to my outdated GTK+-2.18.x version.
Will try to fetch the source of some gtk+-2.20.x and see...

Thank you for the quick reply and providing a precious clue, a starting point from where to proceed further (searching around for the specific function names did not help much).

Best regards,
omero
omero
Posts: 48
Joined: Fri Mar 31, 2023 10:43 am

Re: Help requested with building v2.6.8 gtk+2 on linux old system

Post by omero »

cazfi wrote: Fri Mar 31, 2023 12:04 pm
cazfi wrote: Fri Mar 31, 2023 11:54 amThough you already told that gtk+ version is 2.18, so first step will be to confirm that 'GDK_KEY_plus’ and ‘GDK_KEY_minus' exist there. We may have added their use recently without realizing that they are not backward compatible enough on gtk+2.
That seems to be the case. Those values have been added in gtk+-2.20.

Opened a ticket -> https://osdn.net/projects/freeciv/ticket/47728
Tested the patch. Build goes fine and client runs...
However, I suppose that one really needs gtk+-2.20.x since some panels/views are all scrambled otherwise.
It is however a step forward in respect to a few days ago ;)

Again my sincere thanks!
omero
omero
Posts: 48
Joined: Fri Mar 31, 2023 10:43 am

Re: Help requested with building v2.6.8 gtk+2 on linux old system

Post by omero »

Quick update and good news!

$GDK_NATIVE_WINDOWS=1 ./freeciv268.naldvras.gtk2.0/bin/freeciv-gtk2 -t amplio2 -P sdl

That GDK_NATIVE_WINDOWS=1 solves the scrambling in all tabs/views of the client.
In other words, success!

My sincere thanks for providing the patch and letting me enjoy the game once more :D
Post Reply