Cataclysm compilation errors under linux (NOT DDA) -> SOLVED

Hi,

My question is not about DDA but about original Cataclysm. Ive downloaded it from github and trying to compile it under linux. Ive encountered several problems in code but managed to fix them. But then I started to see following issue. I didn`t found the solution to fix this yet and if someone will point to what direction should I look to fix this I will be grateful.

g++ -O3 -c game.cpp -o obj/game.o In file included from /usr/include/c++/6/bits/char_traits.h:39:0, from /usr/include/c++/6/string:40, from mtype.h:6, from game.h:4, from game.cpp:1: /usr/include/c++/6/bits/stl_algobase.h: In instantiation of ‘static _OI std::__copy_move::__copy_m(_II, _II, _OI) [with _II = game_message*; _OI = game_message*]’: /usr/include/c++/6/bits/stl_algobase.h:386:44: required from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = true; _II = game_message*; _OI = game_message*]’ /usr/include/c++/6/bits/stl_algobase.h:422:45: required from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator<game_message*, std::vector >; _OI = __gnu_cxx::__normal_iterator<game_message*, std::vector >]’ /usr/include/c++/6/bits/stl_algobase.h:487:39: required from ‘_OI std::move(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<game_message*, std::vector >; _OI = __gnu_cxx::__normal_iterator<game_message*, std::vector >]’ /usr/include/c++/6/bits/vector.tcc:145:2: required from ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::_M_erase(std::vector<_Tp, _Alloc>::iterator) [with _Tp = game_message; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<game_message*, std::vector >; typename std::_Vector_base<_Tp, _Alloc>::pointer = game_message*]’ /usr/include/c++/6/bits/stl_vector.h:1148:24: required from ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = game_message; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<game_message*, std::vector >; typename std::_Vector_base<_Tp, _Alloc>::pointer = game_message*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx::__normal_iterator<const game_message*, std::vector >; typename __gnu_cxx::__alloc_traits::_Tp_alloc_type>::const_pointer = const game_message*]’ game.cpp:1886:34: required from here /usr/include/c++/6/bits/stl_algobase.h:343:18: error: use of deleted function ‘game_message& game_message::operator=(game_message&&)’ *__result = std::move(*__first); ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ In file included from game.cpp:1:0: game.h:56:8: note: ‘game_message& game_message::operator=(game_message&&)’ is implicitly deleted because the default definition would be ill-formed: struct game_message ^~~~~~~~~~~~ game.h:56:8: error: invalid initialization of non-const reference of type ‘calendar&’ from an rvalue of type ‘calendar’ In file included from game.h:19:0, from game.cpp:1: calendar.h:55:13: note: initializing argument 1 of ‘calendar& calendar::operator=(calendar&)’ calendar& operator = (calendar &rhs); ^~~~~~~~ Makefile:43: recipe for target 'obj/game.o' failed \make: *** [obj/game.o] Error 1

Thanks in advance!

Newer g++ versions default to newer c++ standards, try passing a -std=c++98 flag. Double check the string, that’s from memory.

Hi,

Thanks a lot Kevin Granade, I was able to compile game.cpp with c++98.
But unfortunately I`ve encountered another problem with map.cpp. I hope it will be the last problem to compile this already.

g++ -std=c++98 -O3 -c map.cpp -o obj/map.o map.cpp: In member function ‘bool map::sees(int, int, int, int, int, int&)’: [glow=red,2,300]map.cpp:1923:15: error: ‘x’ was not declared in this scope[/glow] if (!trans(x, y)) ^ [glow=red,2,300]map.cpp:1935:1: error: expected primary-expression before ‘bool’[/glow] bool map::sees(int Fx, int Fy, int Tx, int Ty, int range, int &tc) ^~~~ [glow=red,2,300]map.cpp:2432:1: error: expected ‘}’ at end of input[/glow] } ^ [glow=red,2,300]map.cpp:2432:1: error: expected ‘}’ at end of input[/glow] Makefile:43: recipe for target 'obj/map.o' failed make: *** [obj/map.o] Error 1

Also, after I will successfully compile the game I will write some kind of a little how to if someone else would want to see the original Cataclysm game.

Thanks!

If you want to try original Cataclysm game you will need to do the following in order to make it compiled.

  1. Download or clone repo from GitHub https://github.com/Whales/Cataclysm
  2. Make sure that you have installed
    apt-get install build-essential module-assistant libncurses5-dev
  3. In iuse.cpp comment out 314 line.
  4. In item.cpp at 282 line add y to health.
  5. In map.cpp comment lines from 1916 through 1930 (everything under //WIP: faster map::sees)
  6. In Makefile add
    43 $(CXX) [glow=red,2,300]-std=c++98[/glow] $(CFLAGS) -c $< -o $@
    to use old version of c++ to compile game.cpp
  7. Run make, wait until it compiles and links then.
  8. In source code folder will be cataclysm file. Just run it ./cataclysm

Hope this will help someone.