ToME 2 maintenance

Everything about ToME 2.x.x. No spoilers, please

Moderator: Moderator

Message
Author
Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME 2 maintenance

#106 Post by Lord Estraven »

Code: Select all

$ pacman -Q boost boost-libs gcc
boost 1.46.0-4
boost-libs 1.46.0-4
gcc 4.5.2-6
These don't appear to be excessively new.

I will say, though, that I am running Arch Linux at the moment. Aside from keeping things on the newish side, Arch seems to have most packages optimized -O2. Maybe that has something to do with this?

AnonymousHero
Spiderkin
Posts: 482
Joined: Sat Mar 18, 2006 12:48 pm

Re: ToME 2 maintenance

#107 Post by AnonymousHero »

You're way ahead of me on the Boost version. (GCC is the same.)

OK, I think it may be as simple as a missed header. Try adding

Code: Select all

#include <boost/shared_ptr.hpp>
along with the other boost includes at the top of the file.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME 2 maintenance

#108 Post by Lord Estraven »

Did that, still getting the exact same error.

AnonymousHero
Spiderkin
Posts: 482
Joined: Sat Mar 18, 2006 12:48 pm

Re: ToME 2 maintenance

#109 Post by AnonymousHero »

I've done some namespace hygiene work in the most recent commit (just pushed) which may solve the problem.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME 2 maintenance

#110 Post by Lord Estraven »

Well it doesn't solve the type problem in gods.cc... And now it bugs out even earlier in the compilation. :?

Code: Select all

/home/proteus/Games/miramors-tome2/src/files.cc: In function ‘bool_ txt_to_html(const char*, const char*, const char*, const char*, bool_, bool_)’:
/home/proteus/Games/miramors-tome2/src/files.cc:3451:61: error: invalid conversion from ‘bool (*)(const std::string&)’ to ‘boost::enable_if_c<true, void>::type*’
/home/proteus/Games/miramors-tome2/src/files.cc:3451:61: error:   initializing argument 2 of ‘boost::filesystem3::path::path(const Source&, typename boost::enable_if<boost::filesystem3::path_traits::is_pathable<typename boost::decay<Source>::type> >::type*) [with Source = char [1024], typename boost::enable_if<boost::filesystem3::path_traits::is_pathable<typename boost::decay<Source>::type> >::type = void]’
make[2]: *** [src/CMakeFiles/tome.dir/files.cc.o] Error 1
make[1]: *** [src/CMakeFiles/tome.dir/all] Error 2
make: *** [all] Error 2

AnonymousHero
Spiderkin
Posts: 482
Joined: Sat Mar 18, 2006 12:48 pm

Re: ToME 2 maintenance

#111 Post by AnonymousHero »

Lord Estraven wrote:Well it doesn't solve the type problem in gods.cc...
Oh, right, I forgot about that. I suppose I should add a fix :).
Lord Estraven wrote: And now it bugs out even earlier in the compilation. :?

Code: Select all

/home/proteus/Games/miramors-tome2/src/files.cc: In function ‘bool_ txt_to_html(const char*, const char*, const char*, const char*, bool_, bool_)’:
/home/proteus/Games/miramors-tome2/src/files.cc:3451:61: error: invalid conversion from ‘bool (*)(const std::string&)’ to ‘boost::enable_if_c<true, void>::type*’
/home/proteus/Games/miramors-tome2/src/files.cc:3451:61: error:   initializing argument 2 of ‘boost::filesystem3::path::path(const Source&, typename boost::enable_if<boost::filesystem3::path_traits::is_pathable<typename boost::decay<Source>::type> >::type*) [with Source = char [1024], typename boost::enable_if<boost::filesystem3::path_traits::is_pathable<typename boost::decay<Source>::type> >::type = void]’
make[2]: *** [src/CMakeFiles/tome.dir/files.cc.o] Error 1
make[1]: *** [src/CMakeFiles/tome.dir/all] Error 2
make: *** [all] Error 2
This is caused by an apparent incompatibility between Boost Filesystem V2 and V3. For now you can comment that if statement -- the code isn't really used for anything right now -- I had to update it to get rid of file_exists().

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME 2 maintenance

#112 Post by Lord Estraven »

Okay thanks, I'll try that...

Nope, loadsave.cc too:

Code: Select all

/home/proteus/Games/miramors-tome2/src/loadsave.cc: In function ‘bool_ load_player()’:
/home/proteus/Games/miramors-tome2/src/loadsave.cc:2144:42: error: invalid conversion from ‘bool (*)(const std::string&)’ to ‘boost::enable_if_c<true, void>::type*’
/home/proteus/Games/miramors-tome2/src/loadsave.cc:2144:42: error:   initializing argument 2 of ‘boost::filesystem3::path::path(const Source&, typename boost::enable_if<boost::filesystem3::path_traits::is_pathable<typename boost::decay<Source>::type> >::type*) [with Source = char [1024], typename boost::enable_if<boost::filesystem3::path_traits::is_pathable<typename boost::decay<Source>::type> >::type = void]’
make[2]: *** [src/CMakeFiles/tome.dir/loadsave.cc.o] Error 1
make[1]: *** [src/CMakeFiles/tome.dir/all] Error 2
make: *** [all] Error 2

AnonymousHero
Spiderkin
Posts: 482
Joined: Sat Mar 18, 2006 12:48 pm

Re: ToME 2 maintenance

#113 Post by AnonymousHero »

Gah.

Try reverting the 2a5ade875685e853391a22fe255b2b5eafcd9288 commit locally and see if that helps.

(Just "git revert 2a5ade875" should do it. Not sure if it'll conflict with later bits in the branch, but it's worth a shot.)

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME 2 maintenance

#114 Post by Lord Estraven »

Unfortunately it conflicts.

Code: Select all

error: could not revert 2a5ade8... Loading/saving: Use boost::filesystem and BOOST_TYPEOF_TPL instead of typeof().
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'

AnonymousHero
Spiderkin
Posts: 482
Joined: Sat Mar 18, 2006 12:48 pm

Re: ToME 2 maintenance

#115 Post by AnonymousHero »

Alright, I'll try to install a more recent Boost in a virtual machine environment to see if I can find a solution.

EDIT: (EDIT#2: scratch that)

EDIT#2: You could also try the very latest revision from the repo; Apparently I was using a deprecated "path" constructor. It now compiles on F15 (which also has a newer Boost), but immediately segfaults on startup.
Last edited by AnonymousHero on Sun Apr 03, 2011 4:31 pm, edited 1 time in total.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME 2 maintenance

#116 Post by Lord Estraven »

That makes it compile... However, there are bunch of "no matching function to call for min/max" errors in casting_context.cc. Casting those as ints almost makes it compile... Then I get this when it tries to link the binary:

Code: Select all

CMakeFiles/tome.dir/cmd5.cc.o: In function `get_level_school(spells::spell const*, int, int)':
cmd5.cc:(.text+0x43f4): undefined reference to `lua_get_level(spells::spell const*, int, int, int, int)'
CMakeFiles/tome.dir/casting_context.cc.o: In function `spells::device_casting_context::scaled_effective_level(spells::spell const*, int, int) const':
casting_context.cc:(.text+0x378): undefined reference to `lua_get_level(spells::spell const*, int, int, int, int)'
collect2: ld returned 1 exit status
make[2]: *** [src/tome] Error 1
make[1]: *** [src/CMakeFiles/tome.dir/all] Error 2
make: *** [all] Error 2
Typo maybe?

AnonymousHero
Spiderkin
Posts: 482
Joined: Sat Mar 18, 2006 12:48 pm

Re: ToME 2 maintenance

#117 Post by AnonymousHero »

Did you do a "make clean" beforehand?

EDIT: See also my edit#2 of the post above yours.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME 2 maintenance

#118 Post by Lord Estraven »

Yeah, 'make clean' doesn't seem to help. I think I'm going to give it a break.

AnonymousHero
Spiderkin
Posts: 482
Joined: Sat Mar 18, 2006 12:48 pm

Re: ToME 2 maintenance

#119 Post by AnonymousHero »

It could be that there are some stale build files still lying around. (EDIT: See (*))

Could you please provide a diff of the changes you did to std::max, std::min to get the code compiling? It's a bit difficult to spot all the cases just by looking at the code :).

(*) EDIT: That is to say: I've sometimes observed "make clean" not cleaning "enough". What you can do to avoid this is issue is to have the build directory separate from the source directory. Something like this:

Code: Select all

$ mkdir src
$ cd src
$ git clone wherever-you-are-cloning-from
$ cd ..
$ mkdir build
$ cd build
$ cmake ../src
Then you can just nuke the "build" directory completely if you want to be absolutely sure that everything is rebuilt without having to worry about any local changes to the source.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME 2 maintenance

#120 Post by Lord Estraven »

AnonymousHero wrote: Could you please provide a diff of the changes you did to std::max, std::min to get the code compiling? It's a bit difficult to spot all the cases just by looking at the code :).
I just did a search/replace on all instances of "min(" and "max(", changing them "min<int>(" and "max<int>(". Ham-fisted, stupid, and probably capable of causing all kinds of problems, but it appeared to work.

Post Reply