GG SVN1040 compile error, boost 1.46, debian sid, gcc 4.5.2

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
metallurge
Space Floater
Posts: 20
Joined: Tue Mar 08, 2011 9:55 pm

GG SVN1040 compile error, boost 1.46, debian sid, gcc 4.5.2

#1 Post by metallurge »

GiGi SVN 1040, FreeOrion SVN 3989
Linux Mint, Debian Edition, pulling from sid repositories

I have compiled & installed the following prerequisites on my own, from source, using gcc 4.5.2-5:

boost 1.46
bullet 2.77
ogre 1.7.2

I was previously successfully able to compile against boost 1.45 using the above sources and gcc 4.4.something.

GiGi compilation now fails:

Code: Select all

[snip...]
[ 22%] Building CXX object src/CMakeFiles/GiGi.dir/Timer.cpp.o
[ 23%] Building CXX object src/CMakeFiles/GiGi.dir/UnicodeCharsets.cpp.o
/root/freeorion-gcc4.5/FreeOrion/GG/src/Texture.cpp: In member function ‘void GG::Texture::Load(const std::string&, bool)’:
/root/freeorion-gcc4.5/FreeOrion/GG/src/Texture.cpp:296:77: error: conversion from ‘boost::filesystem3::path’ to non-scalar type ‘std::string’ requested
In file included from /usr/local/include/boost/filesystem/v3/operations.hpp:25:0,
                 from /usr/local/include/boost/filesystem/operations.hpp:31,
                 from /root/freeorion-gcc4.5/FreeOrion/GG/src/Texture.cpp:35:
/usr/local/include/boost/filesystem/v3/path.hpp: In constructor ‘boost::filesystem3::path::path(InputIterator, InputIterator) [with InputIterator = boost::transform_iterator<boost::algorithm::detail::to_lowerF<boost::filesystem3::path>, boost::filesystem3::path::iterator, boost::use_default, boost::use_default>]’:
/usr/local/include/boost/algorithm/string/detail/case_conv.hpp:113:33:   instantiated from ‘SequenceT boost::algorithm::detail::transform_range_copy(const RangeT&, FunctorT) [with SequenceT = boost::filesystem3::path, RangeT = boost::filesystem3::path, FunctorT = boost::algorithm::detail::to_lowerF<boost::filesystem3::path>]’
/usr/local/include/boost/algorithm/string/case_conv.hpp:79:65:   instantiated from ‘SequenceT boost::algorithm::to_lower_copy(const SequenceT&, const std::locale&) [with SequenceT = boost::filesystem3::path]’
/root/freeorion-gcc4.5/FreeOrion/GG/src/Texture.cpp:296:77:   instantiated from here
/usr/local/include/boost/filesystem/v3/path.hpp:151:9: error: no matching function for call to ‘convert(const boost::filesystem3::path*, const boost::filesystem3::path*, boost::filesystem3::path::string_type&, const boost::filesystem3::path::codecvt_type&)’
/usr/local/include/boost/filesystem/v3/path_traits.hpp:96:8: note: candidates are: void boost::filesystem3::path_traits::convert(const char*, const char*, std::wstring&, const boost::filesystem3::path_traits::codecvt_type&)
/usr/local/include/boost/filesystem/v3/path_traits.hpp:102:8: note:                 void boost::filesystem3::path_traits::convert(const wchar_t*, const wchar_t*, std::string&, const boost::filesystem3::path_traits::codecvt_type&)
/usr/local/include/boost/filesystem/v3/path_traits.hpp:108:8: note:                 void boost::filesystem3::path_traits::convert(const char*, std::wstring&, const boost::filesystem3::path_traits::codecvt_type&)
/usr/local/include/boost/filesystem/v3/path_traits.hpp:117:8: note:                 void boost::filesystem3::path_traits::convert(const wchar_t*, std::string&, const boost::filesystem3::path_traits::codecvt_type&)
/usr/local/include/boost/filesystem/v3/path_traits.hpp:130:8: note:                 void boost::filesystem3::path_traits::convert(const char*, const char*, std::string&, const boost::filesystem3::path_traits::codecvt_type&)
/usr/local/include/boost/filesystem/v3/path_traits.hpp:139:8: note:                 void boost::filesystem3::path_traits::convert(const char*, std::string&, const boost::filesystem3::path_traits::codecvt_type&)
/usr/local/include/boost/filesystem/v3/path_traits.hpp:150:8: note:                 void boost::filesystem3::path_traits::convert(const wchar_t*, const wchar_t*, std::wstring&, const boost::filesystem3::path_traits::codecvt_type&)
/usr/local/include/boost/filesystem/v3/path_traits.hpp:159:8: note:                 void boost::filesystem3::path_traits::convert(const wchar_t*, std::wstring&, const boost::filesystem3::path_traits::codecvt_type&)
make[2]: *** [src/CMakeFiles/GiGi.dir/Texture.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/CMakeFiles/GiGi.dir/all] Error 2
make: *** [all] Error 2
I believe that the root of this originates with a recent change to boost from a default of filesystem v2 to a default of filesystem v3, whereby some of the calling conventions changed.

A temporary fix of
#define BOOST_FILESYSTEM_VERSION 2
is a suggested remedy, but I haven't looked at where the best place to put that would be.

I also suggest a note be added here: http://www.freeorion.org/index.php/Compile_In_Linux, mentioning that GiGi SVN 853->1040 is incompatible with boost 1.46.

metallurge
Space Floater
Posts: 20
Joined: Tue Mar 08, 2011 9:55 pm

Re: GG SVN1040 compile error, boost 1.46, debian sid, gcc 4.5.2

#2 Post by metallurge »

Reported as a bug in GiGi's sourceforge bugtracker.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: GG SVN1040 compile error, boost 1.46, debian sid, gcc 4.5.2

#3 Post by Geoff the Medio »

I suspect the response will be "use boost 1.45" (or 1.44), but thanks.

metallurge
Space Floater
Posts: 20
Joined: Tue Mar 08, 2011 9:55 pm

Re: GG SVN1040 compile error, boost 1.46, debian sid, gcc 4.5.2

#4 Post by metallurge »

Geoff the Medio wrote:I suspect the response will be "use boost 1.45" (or 1.44), but thanks.
Thanks for the response here, and you're welcome. While I elected to compile these dependencies on my own, it looks as though debian intends to go straight from boost 1.42 to 1.46. 1.42 is what is in the mainline repositories, and 1.46 just hit sid (as the first boost upgrade since 1.42) within the last week or so. So I'd personally say that GiGi is going to need to work with 1.46 at some point soon, to take advantage of debian's prebuilt boost. But things are also a bit wacked right now, debian-wise. Even debian sid's ogre3d is presently still compiled against boost 1.42.

Even if y'all don't choose to fix the underlying issue right now, it would be good to note the dependency on 1.44 <= boost <= 1.45 in the compile instructions.

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: GG SVN1040 compile error, boost 1.46, debian sid, gcc 4.5.2

#5 Post by tzlaine »

Fixed in SVN.

vkuzkokov
Space Krill
Posts: 1
Joined: Fri Mar 11, 2011 11:46 pm

Re: GG SVN1040 compile error, boost 1.46, debian sid, gcc 4.5.2

#6 Post by vkuzkokov »

FO itself doesn't seem to compile with Boost.Filesystem v3 either.

Also, "Compile In Linux" explicitly says to install Boost 1.42 on Maverick/Squeeze/Sid while current dev has 1.44 in CMakeLists.txt. That's a bit confusing.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: GG SVN1040 compile error, boost 1.46, debian sid, gcc 4.

#7 Post by Geoff the Medio »

vkuzkokov wrote:Also, "Compile In Linux" explicitly says to install Boost 1.42 on Maverick/Squeeze/Sid while current dev has 1.44 in CMakeLists.txt. That's a bit confusing.
The distro-specific instructions are probably out of date. There no-one actively maintaining them...

Post Reply