Compile Fail: Wesnoth with Boost 1.76.00

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

Moderator: Forum Moderators

Post Reply
erc_the_orc
Posts: 2
Joined: July 7th, 2021, 7:39 pm

Compile Fail: Wesnoth with Boost 1.76.00

Post by erc_the_orc »

I spent the last 4 days trying to compile Wesnoth 1.14.17 on my Ubuntu 20.04LTS system. I finally succeeded a couple of minutes ago.

I think there's a problem with the Boost 1.76.00 libraries, but I'm not a programmer and can't confirm it. Compiling _always_ failed on the wesnoth.c source file when I was using Boost 1.76.00 on my Ubuntu 20.04LTS machine. When I manually deleted most of the 1.76.00 installation and used Ubuntu's 1.71.00 version instead, the program compiled without errors.

Here's a single line from the more than 100 lines of errors generatee by the linker. It may provide a clue as to what is happening, with the error message bolded:

wesnoth.cpp:(.text+0x1156): undefined reference to `boost::iostreams::detail::bzip2_base::bzip2_base(boost::iostreams::bzip2_params const&)'

I installed scons to see if I would get the same error, and sure enough, scons generated a similar error on its conftest_10.cpp test file:

conftest_10.cpp:(.text._ZN5boost9iostreams6detail21bzip2_compressor_implISaIcEEC2ERKNS0_12bzip2_paramsE[_ZN5boost9iostreams6detail21bzip2_compressor_implISaIcEEC5ERKNS0_12bzip2_paramsE]+0x23): undefined reference to `boost::iostreams::detail::bzip2_base::bzip2_base(boost::iostreams::bzip2_params const&)'

I saved text files of the error messages...I think they're too long to post to the forum.

My suspicion? Boost 1.76.00 changed something in its IOSTREAMS headers (which is where bzip2 and other compression methods are defined) that affects the way that the bzip2 library gets turned from a placeholder into a filename.

I didn't have any issues with Boost 1.75.00, as I built Wesnoth on a different computer, running Fedora 34, with that version of Boost, which I installed from one of the Fedora repositories. I do remember being unable to compile Wesnoth using Boost 1.76.00 on that machine, and I down-graded to 1.75.00 and called it good at that point.

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

Re: Compile Fail: Wesnoth with Boost 1.76.00

Post by Pentarctagon »

That would be pretty strange, seeing as on Boost's site they don't list iostreams as a library that changed in 1.76.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
erc_the_orc
Posts: 2
Joined: July 7th, 2021, 7:39 pm

Re: Compile Fail: Wesnoth with Boost 1.76.00

Post by erc_the_orc »

To paraphrase the late Douglas Adams: "Stranger things have been sighted, but not by reliable witnesses."

I would have written it off as a quirk of my machine if the scons test had not also failed - it is a similar line of code to that in wesnoth.c and the error is almost the same. When I diagnose vehicle problems (my day job) remotely, one report is nothing to be concerned about, two reports are enough to start asking questions, and a dozen reports...let's not go there. I figured two failures was enough to report.

By the way...back in September 2020...there was a thread that started with a compile issue and someone else posted about issues with Boost but was not specific. Could this have been an early warning? We will never know.

And - trust me - my machine running Ubuntu has given me tons of reasons to be skeptical. I compile several Amateur (ham) radio programs from source code, and there's still one that I can't get running, which I blame entirely on my lack of programming skills and my machine.

Cheers!

erc_the_orc
shevegen
Posts: 366
Joined: June 3rd, 2004, 4:35 pm

Re: Compile Fail: Wesnoth with Boost 1.76.00

Post by shevegen »

Boost has always been a little bit annoying. For wesnoth I try to not use the latest boost usually as wesnoth didn't like the most recent boost versions in the past. :P

> That would be pretty strange, seeing as on Boost's site they don't list iostreams as a library that changed in 1.76.

Right but perhaps it may be some other problem that already was there in prior boost variants. I recall having complained in the past about specific boost versions. It's a bit sad that C++ requires one to use boost ... boost as .tar.xz tarball clocks at ~102MB here ....

> By the way...back in September 2020...there was a thread that started with a compile issue and someone else posted about issues with Boost but was
> not specific. Could this have been an early warning? We will never know.

Perhaps that was me? I don't remember. I think it would be helpful for the wesnoth team to specify which boost versions may work fine and which ones to avoid.

I don't have any problem with boost right now, but I don't use 1.76.x either. As said it may be better to actually specifically don't use the latest boost version. I am not even certain whether I need the most recent boost for anything really ... you need the latest boost? If not you can try it again at a later time.
User avatar
Pentarctagon
Project Manager
Posts: 4824
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Compile Fail: Wesnoth with Boost 1.76.00

Post by Pentarctagon »

My suggestion would be to stick with the version used by the CI that runs on each commit. For Windows, it's whatever the latest is from vcpkg, for macOS it's whatever is part of MacCompileStuff, and for Linux probably the simplest is to use the same as the version of Ubuntu the CI uses (currently Boost 1.71 from Ubuntu 20.04).
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Post Reply