I can't compile old-version Wesnoth

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderators: Forum Moderators, Developers

Post Reply
Posts: 49
Joined: July 18th, 2015, 8:07 am

I can't compile old-version Wesnoth

Post by nikita1996 »

Recently, I want to see what's the early-aged Wesnoth like, so I downloaded the old version's source code from Sourceforge. However, I failed to compile all the versions before 1.10.

Let me take v1.5.14 as an example. V1.5.14 is the last version of v1.5 series which has two ways to compile -- the "./configure" way and "scons" way. I failed in both of them.

Firstly, I downloaded the source code of v1.5.14 and I unzipped it. I tried to run "./configure" but it reported an error:
checking for the Boost iostreams library... configure: error: Cannot compile a test that uses Boost iostreams
However, I'm sure that I have installed all the lastest boost libraries. I also uninstalled them and compile and reinstall them, but the problem was still there. I ran "apt list libboost*1.65*"and it shows this:

Code: Select all

Listing... Done
libboost-atomic1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-atomic1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-chrono1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-chrono1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-container1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-container1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-context1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-context1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-coroutine1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-coroutine1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-date-time1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-date-time1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-exception1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-fiber1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-fiber1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-filesystem1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-filesystem1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-graph-parallel1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-graph-parallel1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-graph1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-graph1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-iostreams1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-iostreams1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-locale1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-locale1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-log1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-log1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-math1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-math1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-mpi-python1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-mpi-python1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-mpi1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-mpi1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-numpy1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-numpy1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-program-options1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-program-options1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-python1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-python1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-random1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-random1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-regex1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-regex1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-serialization1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-serialization1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-signals1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-signals1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-stacktrace1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-stacktrace1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-system1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-system1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-test1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-test1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-thread1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-thread1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-timer1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-timer1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-type-erasure1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-type-erasure1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-wave1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost-wave1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed,automatic]
libboost1.65-all-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost1.65-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost1.65-doc/bionic,bionic,now 1.65.1+dfsg-0ubuntu5 all [installed]
libboost1.65-tools-dev/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
Then I tried the "scons" way. The "scons" reported a different error and stopped:

Code: Select all

AttributeError: 'module' object has no attribute 'config_checks':
  File "wesnoth-1.5.14/SConstruct", line 210:
    configure_args = dict(custom_tests = init_metasconf(env, ["cplusplus", "python_devel", "sdl", "boost", "pango", "pkgconfig", "gettext"]), config_h = "config.h",
  File "./scons/metasconf.py", line 8:
I also tried to do "cmake" first and then "make" it. Althrough there are several wanings, the "cmake" was completed and build files were written. Then I run "make" but it stopped with an error:

Code: Select all

./src/foreach.hpp:609:95: error: no matching function for call to 'encode_type(std::set<std::__cxx11::basic_string<char> >&, boost::is_const<std::set<std::__cxx11::basic_string<char> > >*)'
     (true ? 0 : boost::foreach_detail_::encode_type(COL, boost::foreach_detail_::is_const(COL)))

I 've tried all the ways I can. However none of them works. Also, under other old versions of Wesnoth, there are similiar problems like these. How can I fix these problem? Thanks!
Last edited by Pentarctagon on July 12th, 2018, 7:02 am, edited 1 time in total.
Reason: Replaced [c] with [code] for multi-line blocks.

User avatar
Project Manager
Posts: 4436
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: I can't compile old-version Wesnoth

Post by Pentarctagon »

Moved to Release Announcements, Compiling & Installation.

Adding the cmake warnings would be useful. For scons, you can check build/config.log and build/sconf_temp for more info on which test went wrong.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

Posts: 290
Joined: June 10th, 2010, 8:49 pm

Re: I can't compile old-version Wesnoth

Post by gnombat »

A couple of ideas:
  1. If you have Windows, it's easier to run old versions, as it's not necessary to compile anything - the old Windows binaries seem to still run even on newer versions of Windows. (I have a bunch of old versions of Wesnoth running on Windows 10, going back as far as Wesnoth 0.9.7.)
  2. I have not tried this, but for compiling old versions, it might be better to use a branch from the Git repository instead of a released version - a Git branch will sometimes receive bug fixes even when there are no more releases from that branch. For example, the 1.8 branch appears to have a number of bug fixes made in 2014 and 2015, even though the last release of the 1.8.x series was in 2011.

User avatar
Project Manager
Posts: 4436
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: I can't compile old-version Wesnoth

Post by Pentarctagon »

Given that he ran the command apt list libboost*1.65*, I think it's safe to assume he's running a linux distro.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: I can't compile old-version Wesnoth

Post by Tad_Carlucci »

It's probably folly to try to run ancient source code with modern libraries.

I'd suggest firing off a new VM, installing the ancient version of Linux, and the various tool chains, and compiling the ancient source on that. Otherwise, you're probably going to be faced with being forced to modify the source to work with your modern tools; which seems to violate the goal of comparing the ancient version, as it was, to the modern one.

Personally, I'd hit the archives (SourceForge and the Wayback Machine would be a good starting points) and try to locate ancient pre-compiled binaries.
I forked real life and now I'm getting merge conflicts.

User avatar
Posts: 485
Joined: July 17th, 2010, 7:40 pm

Re: I can't compile old-version Wesnoth

Post by octalot »

For apt-based distros, there's http://snapshot.debian.org/ which has prebuilt binaries.

http://snapshot.debian.org/package/wesnoth/ has 0.8.11 and up to 1.7.14
During the 1.7 series, the source package naming changed to allow multiple versions (so it's http://snapshot.debian.org/package/wesnoth-1.8/ etc).

If you want to compile from source:
1. Clone the Git repo
2. Re-read Tad's comment and ask yourself how much time you're prepared to spend on this
3. As the error is in src/foreach.hpp, run gitk --all -- src/foreach.hpp to see what's happened to that file
4. Read Tad's comment again and ask yourself how much time you're prepared to spend on this :lol:

User avatar
Site Administrator
Posts: 6695
Joined: November 14th, 2006, 5:54 pm
Location: Chile

Re: I can't compile old-version Wesnoth

Post by Iris »

Instead of trying to build the last 1.5.x development version you might prefer to try the 1.6 branch from Git like it was pointed out above, not only because we sometimes push changes to make old branches buildable on newer (but not necessarily the newest) platforms depending on need/interest, but also because the last development version for any given series is a release candidate for the next stable series, so unless you are testing them out of historical interest you’ll find it more convenient to stick with stable series in general.
octalot wrote:
July 12th, 2018, 8:00 pm
For apt-based distros, there's http://snapshot.debian.org/ which has prebuilt binaries.
Bear in mind that this does not guarantee that the binaries will work correctly or that the packages will be installed without errors due to missing/changed dependencies, as well as distribution incompatibilities (apt-based ≠ compatible with whatever version of Debian the packages were originally built for).

Also, failing all that, you can try installing and running old Windows builds from SF.net using Wine. They are pretty much guaranteed to work (although not necessarily work correctly — see also the whole userdata-in-install-dir debacle on Windows Vista and later) since they ship with all their dependencies.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14).

Posts: 294
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: I can't compile old-version Wesnoth

Post by Shiki »

1.8 can still be built using the version from the repository, as compiler related patches have been pushed.
One needs to have Lua version 5.1 installed for it, and in my case I had to temporarily remove the current version of Lua, there was some problem to detect Lua 5.1 correctly.

1.6 needs as well the version from the repository with additional patches. It will by default compile assuming the C++11 standard, one must add '-ansi' to the CFLAGS and CXXFLAGS.

1.4… I have not much hope… maybe with an old compiler, and possibly additional fixes like the one at the top of the 1.6 and 1.8 branch.

You can take this as reference:
Back in August.

Post Reply