Problem to compile wesnothd server in 1.14.14

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

Moderator: Forum Moderators

Post Reply
demario
Posts: 20
Joined: July 3rd, 2019, 1:05 pm

Problem to compile wesnothd server in 1.14.14

Post by demario »

I have a trouble compiling the MP server wesnothd in the 1.14.14 version.
The error is:

Code: Select all

[ 50%] Building CXX object src/CMakeFiles/wesnothd.dir/server/server.cpp.o
[ 50%] Building CXX object src/CMakeFiles/wesnothd.dir/server/server_base.cpp.o
[ 50%] Building CXX object src/CMakeFiles/wesnothd.dir/server/simple_wml.cpp.o
/opt/wesnoth/wesnoth-1.14.14/src/server/server.cpp: In member function ‘bool wesnothd::server::is_login_allowed(socket_ptr, const simple_wml::node*, const string&, const string&)’:
/opt/wesnoth/wesnoth-1.14.14/src/server/server.cpp:822:12: error: no match for ‘operator!=’ (operand types are ‘std::initializer_list<std::shared_ptr<wesnothd::game> >’ and ‘std::shared_ptr<wesnothd::game>’)
   if(g_ptr != last_sent) {
            ^
/opt/wesnoth/wesnoth-1.14.14/src/server/server.cpp:822:12: note: candidates are:
In file included from /usr/local/include/boost/detail/container_fwd.hpp:98:0,
                 from /usr/local/include/boost/functional/hash/extensions.hpp:22,
                 from /usr/local/include/boost/functional/hash/hash.hpp:558,
                 from /usr/local/include/boost/functional/hash.hpp:6,
                 from /usr/local/include/boost/multi_index/detail/hash_index_args.hpp:17,
                 from /usr/local/include/boost/multi_index/hashed_index_fwd.hpp:16,
                 from /usr/local/include/boost/multi_index/hashed_index.hpp:38,
                 from /opt/wesnoth/wesnoth-1.14.14/src/server/player_connection.hpp:30,
                 from /opt/wesnoth/wesnoth-1.14.14/src/server/server.hpp:24,
                 from /opt/wesnoth/wesnoth-1.14.14/src/server/server.cpp:20:
/usr/include/c++/4.9/complex:481:5: note: template<class _Tp> constexpr bool std::operator!=(const _Tp&, const std::complex<_Tp>&)
     operator!=(const _Tp& __x, const complex<_Tp>& __y)
     ^
/usr/include/c++/4.9/complex:481:5: note:   template argument deduction/substitution failed:
/opt/wesnoth/wesnoth-1.14.14/src/server/server.cpp:822:15: note:   ‘std::shared_ptr<wesnothd::game>’ is not derived from ‘const std::complex<_Tp>’
It seems to be repeating over and over until the compilation stops. I hit the same problem in 1.14.13 first.
I am on debian jessie where I used:

Code: Select all

wesnoth/build$ cmake --version
cmake version 3.6.2
wesnoth/build$ cmake .. -DCMAKE_BUILD_TYPE=Release
wesnoth/build$ make -j4 wesnothd
Some dependencies:
"simply put, it's an old game"T — Cackfiend
User avatar
Pentarctagon
Project Manager
Posts: 4574
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Problem to compile wesnothd server in 1.14.14

Post by Pentarctagon »

So 1.14.12 compiled without errors?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
demario
Posts: 20
Joined: July 3rd, 2019, 1:05 pm

Re: Problem to compile wesnothd server in 1.14.14

Post by demario »

Pentarctagon wrote: So 1.14.12 compiled without errors?
I can't say that. I made a leap step from 1.14.5 to 1.14.13.
I could compile it in 1.14.5 indeed.

[edit]
Soliton wrote: September 23rd, 2020, 2:27 pm Otherwise changing the line to <<< auto g_ptr = record.get_game(); >>> should work as well.
That works for me indeed. Much thanks!
[/edit]
Last edited by demario on September 25th, 2020, 12:33 am, edited 1 time in total.
"simply put, it's an old game"T — Cackfiend
Soliton
Site Administrator
Posts: 1630
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: Problem to compile wesnothd server in 1.14.14

Post by Soliton »

GCC 4.9.2 is pretty old. Can you use a newer compiler? (at least GCC 5.1)

Otherwise changing the line to

Code: Select all

 auto g_ptr = record.get_game();
should work as well.
"If gameplay requires it, they can be made to live on Venus." -- scott
shevegen
Posts: 293
Joined: June 3rd, 2004, 4:35 pm

Re: Problem to compile wesnothd server in 1.14.14

Post by shevegen »

I am not sure if this is necessarily related to an old GCC. From experience
compiling wesnoth from source, boost tends to give me a LOT more problems
than GCC typically does. 4.9.2 is quite old indeed though, I also don't trust
old systems. It often means that people have a hard time upgrading these
systems. My GCC is 10.2.0 but unfortunately I also run into problems compiling
wesnoth from source right now.

Example:

[ 70%] mo-update [wesnoth-ei-nl]: Creating mo file.
[ 70%] mo-update [wesnoth-httt-nl]: Creating mo file.
[ 70%] mo-update [wesnoth-help-nl]: Creating mo file.
[ 70%] mo-update [wesnoth-l-nl]: Creating mo file.
[ 70%] mo-update [wesnoth-lib-nl]: Creating mo file.
[ 70%] mo-update [wesnoth-multiplayer-nl]: Creating mo file.
[ 70%] mo-update [wesnoth-low-nl]: Creating mo file.
/usr/bin/ld: libwesnoth-core.a(filesystem_boost.cpp.o): in function `filesystem::get_dir(boost::filesystem::path const&)':
filesystem_boost.cpp:(.text+0x1237): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::filesystem::path const*, boost::system::error_code*)'
/usr/bin/ld: libwesnoth-core.a(filesystem_boost.cpp.o): in function `filesystem::create_directory_if_missing(boost::filesystem::path const&)':
filesystem_boost.cpp:(.text+0x1a8b): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::filesystem::path const*, boost::system::error_code*)'
/usr/bin/ld: libwesnoth-core.a(filesystem_boost.cpp.o): in function `filesystem::make_directory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
filesystem_boost.cpp:(.text+0x3c9b): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::filesystem::path const*, boost::system::error_code*)'
/usr/bin/ld: libwesnoth-core.a(filesystem_boost.cpp.o): in function `filesystem::normalize_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool)':
filesystem_boost.cpp:(.text+0x5006): undefined reference to `boost::filesystem::detail::absolute(boost::filesystem::path const&, boost::filesystem::path const&, boost::system::error_code*)'

I don't mean to distract from the thread here, but this is boost annoying people again. (I followed
these instructions as-is: http://www.linuxfromscratch.org/blfs/vi ... boost.html - I understand
that I can not easily combine different boost versions with wesnoth, but it is also really tedious to
have to carry a particular boost version about only for wesnoth ... it's not a good situation IMO, boost
is simply way too complex and complicated. At the least that has been my impression in general
with projects that begin to depend on boost due to the niceties it offers ...).
User avatar
Pentarctagon
Project Manager
Posts: 4574
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Problem to compile wesnothd server in 1.14.14

Post by Pentarctagon »

Was your boost built with C++11 support?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Soliton
Site Administrator
Posts: 1630
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: Problem to compile wesnothd server in 1.14.14

Post by Soliton »

shevegen wrote: September 23rd, 2020, 8:47 pm I understand
that I can not easily combine different boost versions with wesnoth, but it is also really tedious to
have to carry a particular boost version about only for wesnoth ... it's not a good situation IMO, boost
is simply way too complex and complicated.
What do you base this on? There is a minimum needed boost version that is 8 years old for 1.14 or 6 years old for 1.15.

Your linker error looks like stale object files. Perhaps because boost was updated. Or a broken boost install with mismatched headers and libs. Try a clean build.
"If gameplay requires it, they can be made to live on Venus." -- scott
Post Reply