Accounts e-mail HP

Compiling freeciv on Ubuntu

You can get help here for any kind of problem ranging from Freeciv to the website.

Compiling freeciv on Ubuntu

Postby obryant » Tue Nov 29, 2011 8:08 pm

I can (and do) play freeciv using Ubuntu 11.10, installed through the package repositories. It is freeciv 2.2.7.

I'd like to try Greatturn, and therefore would like to have freeciv 2.3.1. Does anybody have a cheat-sheet for getting it to compile on Ubuntu?

I think the cheat-sheet will look something like:
  1. Download the source
  2. unpack the source
  3. sudo apt-get ???
  4. ./configure
  5. make install
I'm not sure what to do about step (3). When I try run the configure script, the following output seems relevant:

Code: Select all
checking for GTK+ - version >= 2.6.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.

because later configure ends with the notice:

Code: Select all
configure: error: could not guess which client to compile

Compiling freeciv on Ubuntu

Postby cazfi » Thu Dec 01, 2011 1:59 pm

obryant wrote: Code:
checking for GTK+ - version >= 2.6.0... no

That particular problem should be solved by "apt-get install libgtk2.0-dev". I don't have full list of dependency packages available, so cannot tell what other packages to install before seeing what errors you (will) get.

Note that Ubuntu has problem that they have hacked around in the version in their repository. When running freeciv 2.3.1 compiled from our (upstream) sources, you need to set environment variable "GDK_NATIVE_WINDOWS=1"

Also, default "make install" will probably overwrite files from freeciv version you have installed from Ubuntu repository (if any). You may want to give "--prefix" -parameter to configure to install freeciv you compile yourself to different location.

Code: Select all
> cd freeciv-2.3.1
> mkdir build
> cd build
> ../configure --prefix=/home/obryant/freeciv/2.3.1
> make install
> GDK_NATIVE_WINDOWS=1 /home/obryant/freeciv/2.3.1/bin/freeciv-gtk2

Compiling freeciv on Ubuntu

Postby obryant » Sat Dec 03, 2011 10:18 am

Thanks cazfi, I can now compile. Synaptic didn't show libgtk2.0-dev, but I was able to get it through the command line. Also, "make install" needed a sudo.

If I load 2.2.7 saved game into 2.3.1, it just starts a new game instead. Could that be because it's installed in a nonstandard place?

Compiling freeciv on Ubuntu

Postby obryant » Tue Dec 06, 2011 6:19 am

I also needed to adjust the .desktop file located in

to include the line

    Exec=env GDK_NATIVE_WINDOWS=1 /home/freeciv/2.3.1/bin/freeciv-gtk2
(and then copy this file to your desktop). I'm such a noob.

Return to General tech support

Who is online

Users browsing this forum: No registered users and 1 guest