Problems building from svn on linux

That’s weird. It works for me with same compiler and I don’t see what may be wrong here. Different boost version?

Try this:
Open file lib/logging/CLogger.cpp, line 200 and replace current code:

BOOST_FOREACH(auto & target, logger->targets)

with this:

for (auto & target : logger->targets)

OR if this will not help try this:
File lib/logging/CLogger.h, line 119
Replace this:

std::list<unique_ptr<ILogTarget> > targets;

With this:

std::vector<unique_ptr<ILogTarget> > targets;

The fist one helped. But after that I have to change OVERRIDE -> override in next files:
server/CQuery.h
lib/CThreadHelper.cpp
lib/CObstacleInstance.h
At least it compiled. I’ll try to play with it today.

Damn… Sorry for the noise. All problems were solved by updating system and gcc.

Revision 3432

 98%] Building CXX object test/CMakeFiles/vcmitest.dir/CMapEditManagerTest.cpp.o
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp: In member function ‘void CMapEditManager_DrawTerrain_View::test_method()’:
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:95:17: error: expected primary-expression before ‘const’
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:95:48: error: ‘BOOST_FOREACH’ was not declared in this scope
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:96:3: error: expected ‘;’ before ‘{’ token
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:91:8: warning: unused variable ‘editManager’ -Wunused-variable]
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:139:1: error: expected ‘}’ at end of input
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:139:1: error: expected ‘catch’ at end of input
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:139:1: error: expected ‘(’ at end of input
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:139:1: error: expected type-specifier at end of input
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:139:1: error: expected ‘)’ at end of input
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:139:1: error: expected ‘{’ at end of input
/mnt/another/tmp/vcmi/test/CMapEditManagerTest.cpp:139:1: error: expected ‘}’ at end of input
/usr/include/boost-1_49/boost/system/error_code.hpp: At global scope:
/usr/include/boost-1_49/boost/system/error_code.hpp:214:36: warning: ‘boost::system::posix_category’ defined but not used -Wunused-variable]
/usr/include/boost-1_49/boost/system/error_code.hpp:215:36: warning: ‘boost::system::errno_ecat’ defined but not used -Wunused-variable]
/usr/include/boost-1_49/boost/system/error_code.hpp:216:36: warning: ‘boost::system::native_ecat’ defined but not used -Wunused-variable]
make[2]: *** [test/CMakeFiles/vcmitest.dir/CMapEditManagerTest.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/vcmitest.dir/all] Error 2
make: *** [all] Error 2

Revision 3433:

 65%] Building CXX object AI/FuzzyLite/CMakeFiles/FuzzyLite_lib.dir/AreaCentroidAlgorithm.cpp.o
In file included from /mnt/another/tmp/vcmi/AI/FuzzyLite/LinguisticTerm.h:29:0,
                 from /mnt/another/tmp/vcmi/AI/FuzzyLite/AreaCentroidAlgorithm.cpp:18:
/mnt/another/tmp/vcmi/AI/FuzzyLite/defs.h:40:0: warning: "isnan" redefined [enabled by default]
/usr/include/math.h:259:0: note: this is the location of the previous definition
/mnt/another/tmp/vcmi/AI/FuzzyLite/defs.h:41:32: error: expected unqualified-id before 'sizeof'
/mnt/another/tmp/vcmi/AI/FuzzyLite/defs.h:41:32: error: expected ')' before 'sizeof'
make[2]: *** [AI/FuzzyLite/CMakeFiles/FuzzyLite_lib.dir/AreaCentroidAlgorithm.cpp.o] Error 1
make[1]: *** [AI/FuzzyLite/CMakeFiles/FuzzyLite_lib.dir/all] Error 2
make: *** [all] Error 2

Sorry for this, please try r3434.

I had to revert std::bind to boost::bind (r3435). It worked in most cases… but there was a number of uses that was making VS 2012 compiler go mad. Seems to be VS2012-specific bug because the same code works fine with VS 2013 Preview.

I haven’t checked in detail what is the exact cause — if std::bind does not reliably work, we need to stick with boost::bind. At least till we support VS 2012.

There is still [forum.vcmi.eu/t/problems-building-from-svn-on-linux/686/24) error.

I don’t know what’s wrong there, the project can be excluded from the build (it contains just the tests for map edit manager).

Please try replacing BOOST_FOREACH(a, b) with for(a : b). If it won’t help, at least we might get better error message.

Yep, that fixes the error.

Sorry it’s not related, I’m posting here because I’m not a member yet and cannot open a new thread. It would be great if the game could go with any version of boost without insisting on a specific build. For example yesterday I upgraded to Fedora 19 and now instead of boost 1.50 I have 1.53 and the game won’t start. I tried to cheat it by making symlinks but it recognised the wrong version, but I believe there is no reason to require a certain version, as long as boost exists on the system. Am I wrong? I’ve used to compile the game from source, but why should I do it if I have a package (me? lazy? naaa). So, is there a way to trick the game without recompiling it or waiting for the next release? Thank you!!

When it comes to such libraries like boost even minor difference in version may end badly. So no - vcmi compiled with boost 1.50 must use 1.50 in runtime.

This restriction was not made by us but rather by compiler and boost library.

However at least Ubuntu supports installation of multiple versions of boost at once. For example right now I have installed package “boost1.46” as well as “boost1.48”. This may not be applicable to Fedora but such possibility exists.

Rev 3440:

Oh bummer :frowning:
Hmm yes it’s possible with yum to install a newer version of a package, and it will co-exist with the older version as long as the exact version number is specified and ‘yum update’ hasn’t run yet.

I’m afraid it won’t help in the case of fedora, because its release cycle overlaps with vcmi’s cycle, and the wanted version is always the one that came with the previous release (and it’s usually a bad idea to mix dependencies from different releases).

So next time I’ll be less hasty and stick with the current release a bit longer to enjoy vcmi :slight_smile: (too lazy to switch a distro, I have a reputation to maintain after all)