Compile(make) error

Hey out there.
I’m trying to compile vcmi for my openpandora devivce.
I use a cross-compiler with debian6 (described here: pandorawiki.org/Setting_up_a_cross-compiler).
Compiling works fine, afer I wrote a few cmake-files…
When I try to “make” vcmi the following error occure:

pandora@pandora-yactefeau:~/build/vcmi-0.90/trunk/build$ cmake ../src/
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc
-- Check for working C compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++
-- Check for working CXX compiler: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found ZLIB: /usr/include
-- DEFAULT_MESSAGE  (missing:  FFMPEG_LIBRARIES)
-- Looking for shm_open in rt
-- Looking for shm_open in rt - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pandora/build/vcmi-0.90/trunk/build
pandora@pandora-yactefeau:~/build/vcmi-0.90/trunk/build$ make
Scanning dependencies of target vcmi
  1%] Building CXX object lib/CMakeFiles/vcmi.dir/Filesystem/CBinaryReader.cpp.o
In file included from /home/pandora/build/vcmi-0.90/trunk/src/lib/StdInc.h:3,
                 from /home/pandora/build/vcmi-0.90/trunk/src/lib/Filesystem/CBinaryReader.cpp:1:
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h: In function ‘int vstd::find_pos(const Container&, const T2&)’:
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:258: error: ISO C++ forbids declaration of ‘iter’ with no type
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:259: error: invalid type argument of ‘unary *’
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h: At global scope:
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:380: error: expected constructor, destructor, or type conversion before ‘<’ token
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:385: error: expected constructor, destructor, or type conversion before ‘<’ token
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:390: error: expected constructor, destructor, or type conversion before ‘<’ token
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h: In function ‘typename Container::const_reference vstd::circularAt(const Container&, size_t)’:
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:400: error: ISO C++ forbids declaration of ‘itr’ with no type
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:402: error: invalid type argument of ‘unary *’
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h: In function ‘void vstd::erase_if(std::set<Elem, std::less<_Key>, std::allocator<_CharT> >&, Predicate)’:
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:414: error: ISO C++ forbids declaration of ‘itr’ with no type
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:415: error: ISO C++ forbids declaration of ‘endItr’ with no type
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:418: error: ISO C++ forbids declaration of ‘tmpItr’ with no type
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:419: error: invalid type argument of ‘unary *’
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h: In function ‘void vstd::erase_if(std::map<KeyT, ValT, std::less<_Key>, std::allocator<std::pair<const _Key, _Tp> > >&, Predicate)’:
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:428: error: ISO C++ forbids declaration of ‘itr’ with no type
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:429: error: ISO C++ forbids declaration of ‘endItr’ with no type
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:432: error: ISO C++ forbids declaration of ‘tmpItr’ with no type
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:433: error: invalid type argument of ‘unary *’
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h: In function ‘OutputIterator vstd::copy_if(const InputRange&, OutputIterator, Predicate)’:
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:441: error: ‘copy_if’ is not a member of ‘std’
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h: At global scope:
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:452: error: expected initializer before ‘->’ token
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:463: error: expected initializer before ‘->’ token
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:474: error: ‘std::unique_ptr’ has not been declared
/home/pandora/build/vcmi-0.90/trunk/src/lib/../Global.h:476: error: ‘vstd::make_unique’ has not been declared
make[2]: *** [lib/CMakeFiles/vcmi.dir/Filesystem/CBinaryReader.cpp.o] Error 1
make[1]: *** [lib/CMakeFiles/vcmi.dir/all] Error 2
make: *** [all] Error 2

The problem seems to be regarded to boost (when you look at the specific lines in Global.h).
On the pandora boost*1.41 (upgraded to 1.51; same error) is installed.

Have you any ideas which would help me?

sorry I upgraded to 1.49 but is doesn’t help…

It seems you are compiling this as C++98 code. VCMI requires reasonably conforming C++11 compiler, eg. GCC 4.5+ or Clang 3.1+, most likely you are using an older one.
[Or it could be that -std=c++0x option is missing, but it should not be the case with makefile generated by cmake.]

The boost requirement was at least 1.44 AFAIR, though basically the newer the better. :wink: (1.49 should be perfectly fine)

I remember some missing files issues with 1.44. What works for me is:
at least gcc-4.5 with boost 1.46
at least clang-3.1 with boost 1.48

Probably we should add some checks for compiler version - errors like these are far from self-descriptive.

Anything we should know? CMake support is still quite new so some platforms may not be supported well.