D: [iurt_root_command] chroot Installing /home/pterjan/rpmbuild/SRPMS/keeperrl-0.0.22-1.mga7.src.rpm Executing(%prep): /bin/sh -e /home/pterjan/rpmbuild/tmp/rpm-tmp.xxhyzO + umask 022 + cd /home/pterjan/rpmbuild/BUILD + '[' 1 -eq 1 ']' + '[' 1 -eq 1 ']' + '[' 1 -eq 1 ']' + cd /home/pterjan/rpmbuild/BUILD + rm -rf keeperrl-alpha22 + /usr/bin/tar -xof - + /usr/bin/gzip -dc /home/pterjan/rpmbuild/SOURCES/keeperrl-alpha22.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd keeperrl-alpha22 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/bin/cat /home/pterjan/rpmbuild/SOURCES/keeperrl-0.0.22-mga-makefile.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch + /usr/bin/cat /home/pterjan/rpmbuild/SOURCES/keeperrl-0.0.22-mga-userpath.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch + exit 0 Executing(%build): /bin/sh -e /home/pterjan/rpmbuild/tmp/rpm-tmp.xC7bP6 + umask 022 + cd /home/pterjan/rpmbuild/BUILD + cd keeperrl-alpha22 + '[' 1 -eq 1 ']' + '[' 1 -eq 1 ']' + CFLAGS='-O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4' + export CFLAGS + CXXFLAGS='-O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4' + export CXXFLAGS + FFLAGS='-O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4' + export FFLAGS + LDFLAGS=' -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags' + export LDFLAGS + /usr/bin/make -O -j8 RELEASE=ON OPT=ON DATA_DIR=/usr/share/games/keeperrl Using built-in specs. COLLECT_GCC=g++ bash ./gen_version.sh ./gen_version.sh: line 3: git: command not found g++ -MMD -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -c audio_device.cpp -o obj-opt/audio_device.o In file included from audio_device.cpp:1:0: stdafx.h:115:12: error: 'std::function' has not been declared using std::function; ^~~~~~~~ In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from audio_device.h:3, from audio_device.cpp:8: ./debug.h:59:31: error: 'function' has not been declared static DebugOutput toString(function callback); ^~~~~~~~ ./debug.h:59:39: error: expected ',' or '...' before '<' token static DebugOutput toString(function callback); ^ ./debug.h:62:11: error: 'function' does not name a type; did you mean 'union'? typedef function LineEndFun; ^~~~~~~~ union ./debug.h:64:3: error: 'LineEndFun' does not name a type LineEndFun onLineEnd; ^~~~~~~~~~ ./debug.h:67:32: error: 'LineEndFun' has not been declared DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~~ ./debug.h: In constructor 'DebugOutput::DebugOutput(std::ostream&, int)': ./debug.h:67:58: error: class 'DebugOutput' does not have any field named 'onLineEnd' DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~ ./debug.h: In destructor 'DebugLog::Logger::~Logger()': ./debug.h:86:20: error: '__gnu_cxx::__alloc_traits >::value_type {aka class DebugOutput}' has no member named 'onLineEnd' outputs[i].onLineEnd(); ^~~~~~~~~ In file included from extern/variant_serialize.h:3:0, from serialization.h:37, from util.h:24, from audio_device.h:3, from audio_device.cpp:8: extern/variant.h: In lambda function: extern/variant.h:406:99: error: expected '(' before '>' token typename std::remove_const::type>::type>() == o1; } ); ^ extern/variant.h:406:101: error: expected primary-expression before ')' token typename std::remove_const::type>::type>() == o1; } ); ^ In file included from audio_device.h:3:0, from audio_device.cpp:8: util.h: At global scope: util.h:63:19: error: 'function' was not declared in this scope T lambdaConstruct(function fun) { ^~~~~~~~ util.h:63:19: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from audio_device.h:3, from audio_device.cpp:8: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from audio_device.h:3:0, from audio_device.cpp:8: util.h:63:28: error: expected primary-expression before 'void' T lambdaConstruct(function fun) { ^~~~ util.h:63:43: error: expected ';' before '{' token T lambdaConstruct(function fun) { ^ util.h:74:9: error: 'function' does not name a type; did you mean 'union'? typedef function ItemPredicate; ^~~~~~~~ union util.h:167:11: error: 'function' does not name a type; did you mean 'union'? typedef function LinearMap; ^~~~~~~~ union util.h:256:25: error: 'Vec2::LinearMap' has not been declared Rectangle apply(Vec2::LinearMap) const; ^~~~~~~~~ util.h:390:19: error: expected ')' before '<' token EnumMap(function f) { ^ util.h:794:53: error: 'function' has not been declared map > groupBy(const vector& values, function getKey) { ^~~~~~~~ util.h:794:61: error: expected ',' or '...' before '<' token map > groupBy(const vector& values, function getKey) { ^ util.h:904:1: error: 'function' does not name a type; did you mean 'union'? function alwaysTrue() { ^~~~~~~~ union util.h:909:1: error: 'function' does not name a type; did you mean 'union'? function alwaysFalse() { ^~~~~~~~ union util.h:914:1: error: 'function' does not name a type; did you mean 'union'? function andFun(function x, const function y) { ^~~~~~~~ union util.h:920:18: error: expected ')' before '<' token OnExit(function f) : fun(f) {} ^ util.h:925:3: error: 'function' does not name a type; did you mean 'union'? function fun; ^~~~~~~~ union util.h: In destructor 'OnExit::~OnExit()': util.h:922:15: error: 'fun' was not declared in this scope ~OnExit() { fun(); } ^~~ util.h: At global scope: util.h:1415:21: error: expected ')' before '<' token AsyncLoop(function init, function loop); ^ util.h:1416:21: error: expected ')' before '<' token AsyncLoop(function); ^ util.h:1427:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(void (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1432:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(Ret (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1437:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(void (*ptr) (Args...)) { ^~~~~~~~ union util.h:1442:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(Ret (*ptr) (Args...)) { ^~~~~~~~ union util.h:1447:31: error: expected ')' before '<' token ConstructorFunction(function inConstructor); ^ util.h:1451:30: error: expected ')' before '<' token DestructorFunction(function inDestructor); ^ util.h:1455:3: error: 'function' does not name a type; did you mean 'union'? function destFun; ^~~~~~~~ union audio_device.cpp: In constructor 'SoundStream::SoundStream(const FilePath&, double)': audio_device.cpp:159:73: error: no matching function for call to 'AsyncLoop::AsyncLoop(SoundStream::SoundStream(const FilePath&, double)::, SoundStream::SoundStream(const FilePath&, double)::)' streamer([path, this]{ init(path);}, [volume, this]{loop(volume);}) { ^ In file included from audio_device.h:3:0, from audio_device.cpp:8: util.h:1413:7: note: candidate: AsyncLoop::AsyncLoop() class AsyncLoop { ^~~~~~~~~ util.h:1413:7: note: candidate expects 0 arguments, 2 provided make[1]: *** [Makefile:112: obj-opt/audio_device.o] Error 1 make[1]: *** Waiting for unfinished jobs.... g++ -MMD -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -c attack.cpp -o obj-opt/attack.o In file included from attack.cpp:16:0: stdafx.h:115:12: error: 'std::function' has not been declared using std::function; ^~~~~~~~ In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from attack.h:19, from attack.cpp:18: ./debug.h:59:31: error: 'function' has not been declared static DebugOutput toString(function callback); ^~~~~~~~ ./debug.h:59:39: error: expected ',' or '...' before '<' token static DebugOutput toString(function callback); ^ ./debug.h:62:11: error: 'function' does not name a type; did you mean 'union'? typedef function LineEndFun; ^~~~~~~~ union ./debug.h:64:3: error: 'LineEndFun' does not name a type LineEndFun onLineEnd; ^~~~~~~~~~ ./debug.h:67:32: error: 'LineEndFun' has not been declared DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~~ ./debug.h: In constructor 'DebugOutput::DebugOutput(std::ostream&, int)': ./debug.h:67:58: error: class 'DebugOutput' does not have any field named 'onLineEnd' DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~ ./debug.h: In destructor 'DebugLog::Logger::~Logger()': ./debug.h:86:20: error: '__gnu_cxx::__alloc_traits >::value_type {aka class DebugOutput}' has no member named 'onLineEnd' outputs[i].onLineEnd(); ^~~~~~~~~ In file included from extern/variant_serialize.h:3:0, from serialization.h:37, from util.h:24, from attack.h:19, from attack.cpp:18: extern/variant.h: In lambda function: extern/variant.h:406:99: error: expected '(' before '>' token typename std::remove_const::type>::type>() == o1; } ); ^ extern/variant.h:406:101: error: expected primary-expression before ')' token typename std::remove_const::type>::type>() == o1; } ); ^ In file included from attack.h:19:0, from attack.cpp:18: util.h: At global scope: util.h:63:19: error: 'function' was not declared in this scope T lambdaConstruct(function fun) { ^~~~~~~~ util.h:63:19: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from attack.h:19, from attack.cpp:18: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from attack.h:19:0, from attack.cpp:18: util.h:63:28: error: expected primary-expression before 'void' T lambdaConstruct(function fun) { ^~~~ util.h:63:43: error: expected ';' before '{' token T lambdaConstruct(function fun) { ^ util.h:74:9: error: 'function' does not name a type; did you mean 'union'? typedef function ItemPredicate; ^~~~~~~~ union util.h:167:11: error: 'function' does not name a type; did you mean 'union'? typedef function LinearMap; ^~~~~~~~ union util.h:256:25: error: 'Vec2::LinearMap' has not been declared Rectangle apply(Vec2::LinearMap) const; ^~~~~~~~~ util.h:390:19: error: expected ')' before '<' token EnumMap(function f) { ^ util.h:794:53: error: 'function' has not been declared map > groupBy(const vector& values, function getKey) { ^~~~~~~~ util.h:794:61: error: expected ',' or '...' before '<' token map > groupBy(const vector& values, function getKey) { ^ util.h:904:1: error: 'function' does not name a type; did you mean 'union'? function alwaysTrue() { ^~~~~~~~ union util.h:909:1: error: 'function' does not name a type; did you mean 'union'? function alwaysFalse() { ^~~~~~~~ union util.h:914:1: error: 'function' does not name a type; did you mean 'union'? function andFun(function x, const function y) { ^~~~~~~~ union util.h:920:18: error: expected ')' before '<' token OnExit(function f) : fun(f) {} ^ util.h:925:3: error: 'function' does not name a type; did you mean 'union'? function fun; ^~~~~~~~ union util.h: In destructor 'OnExit::~OnExit()': util.h:922:15: error: 'fun' was not declared in this scope ~OnExit() { fun(); } ^~~ util.h: At global scope: util.h:1415:21: error: expected ')' before '<' token AsyncLoop(function init, function loop); ^ util.h:1416:21: error: expected ')' before '<' token AsyncLoop(function); ^ util.h:1427:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(void (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1432:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(Ret (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1437:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(void (*ptr) (Args...)) { ^~~~~~~~ union util.h:1442:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(Ret (*ptr) (Args...)) { ^~~~~~~~ union util.h:1447:31: error: expected ')' before '<' token ConstructorFunction(function inConstructor); ^ util.h:1451:30: error: expected ')' before '<' token DestructorFunction(function inDestructor); ^ util.h:1455:3: error: 'function' does not name a type; did you mean 'union'? function destFun; ^~~~~~~~ union make[1]: *** [Makefile:112: obj-opt/attack.o] Error 1 g++ -MMD -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -c animation.cpp -o obj-opt/animation.o In file included from animation.cpp:1:0: stdafx.h:115:12: error: 'std::function' has not been declared using std::function; ^~~~~~~~ In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from animation.h:3, from animation.cpp:3: ./debug.h:59:31: error: 'function' has not been declared static DebugOutput toString(function callback); ^~~~~~~~ ./debug.h:59:39: error: expected ',' or '...' before '<' token static DebugOutput toString(function callback); ^ ./debug.h:62:11: error: 'function' does not name a type; did you mean 'union'? typedef function LineEndFun; ^~~~~~~~ union ./debug.h:64:3: error: 'LineEndFun' does not name a type LineEndFun onLineEnd; ^~~~~~~~~~ ./debug.h:67:32: error: 'LineEndFun' has not been declared DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~~ ./debug.h: In constructor 'DebugOutput::DebugOutput(std::ostream&, int)': ./debug.h:67:58: error: class 'DebugOutput' does not have any field named 'onLineEnd' DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~ ./debug.h: In destructor 'DebugLog::Logger::~Logger()': ./debug.h:86:20: error: '__gnu_cxx::__alloc_traits >::value_type {aka class DebugOutput}' has no member named 'onLineEnd' outputs[i].onLineEnd(); ^~~~~~~~~ In file included from extern/variant_serialize.h:3:0, from serialization.h:37, from util.h:24, from animation.h:3, from animation.cpp:3: extern/variant.h: In lambda function: extern/variant.h:406:99: error: expected '(' before '>' token typename std::remove_const::type>::type>() == o1; } ); ^ extern/variant.h:406:101: error: expected primary-expression before ')' token typename std::remove_const::type>::type>() == o1; } ); ^ In file included from animation.h:3:0, from animation.cpp:3: util.h: At global scope: util.h:63:19: error: 'function' was not declared in this scope T lambdaConstruct(function fun) { ^~~~~~~~ util.h:63:19: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from animation.h:3, from animation.cpp:3: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from animation.h:3:0, from animation.cpp:3: util.h:63:28: error: expected primary-expression before 'void' T lambdaConstruct(function fun) { ^~~~ util.h:63:43: error: expected ';' before '{' token T lambdaConstruct(function fun) { ^ util.h:74:9: error: 'function' does not name a type; did you mean 'union'? typedef function ItemPredicate; ^~~~~~~~ union util.h:167:11: error: 'function' does not name a type; did you mean 'union'? typedef function LinearMap; ^~~~~~~~ union util.h:256:25: error: 'Vec2::LinearMap' has not been declared Rectangle apply(Vec2::LinearMap) const; ^~~~~~~~~ util.h:390:19: error: expected ')' before '<' token EnumMap(function f) { ^ util.h:794:53: error: 'function' has not been declared map > groupBy(const vector& values, function getKey) { ^~~~~~~~ util.h:794:61: error: expected ',' or '...' before '<' token map > groupBy(const vector& values, function getKey) { ^ util.h:904:1: error: 'function' does not name a type; did you mean 'union'? function alwaysTrue() { ^~~~~~~~ union util.h:909:1: error: 'function' does not name a type; did you mean 'union'? function alwaysFalse() { ^~~~~~~~ union util.h:914:1: error: 'function' does not name a type; did you mean 'union'? function andFun(function x, const function y) { ^~~~~~~~ union util.h:920:18: error: expected ')' before '<' token OnExit(function f) : fun(f) {} ^ util.h:925:3: error: 'function' does not name a type; did you mean 'union'? function fun; ^~~~~~~~ union util.h: In destructor 'OnExit::~OnExit()': util.h:922:15: error: 'fun' was not declared in this scope ~OnExit() { fun(); } ^~~ util.h: At global scope: util.h:1415:21: error: expected ')' before '<' token AsyncLoop(function init, function loop); ^ util.h:1416:21: error: expected ')' before '<' token AsyncLoop(function); ^ util.h:1427:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(void (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1432:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(Ret (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1437:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(void (*ptr) (Args...)) { ^~~~~~~~ union util.h:1442:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(Ret (*ptr) (Args...)) { ^~~~~~~~ union util.h:1447:31: error: expected ')' before '<' token ConstructorFunction(function inConstructor); ^ util.h:1451:30: error: expected ')' before '<' token DestructorFunction(function inDestructor); ^ util.h:1455:3: error: 'function' does not name a type; did you mean 'union'? function destFun; ^~~~~~~~ union In file included from animation.h:4:0, from animation.cpp:3: renderer.h:212:22: error: 'function' has not been declared void addRenderElem(function); ^~~~~~~~ renderer.h:212:30: error: expected ',' or '...' before '<' token void addRenderElem(function); ^ renderer.h:216:16: error: 'function' was not declared in this scope array>, 2> renderList; ^~~~~~~~ renderer.h:216:16: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from animation.h:3, from animation.cpp:3: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from animation.h:4:0, from animation.cpp:3: renderer.h:216:30: error: template argument 1 is invalid array>, 2> renderList; ^ renderer.h:216:31: error: wrong number of template arguments (1, should be 2) array>, 2> renderList; ^~ In file included from /usr/include/c++/7.2.2/tuple:39:0, from /usr/include/c++/7.2.2/bits/unique_ptr.h:37, from /usr/include/c++/7.2.2/memory:80, from stdafx.h:46, from animation.cpp:1: /usr/include/c++/7.2.2/array:94:12: note: provided for 'template struct std::array' struct array ^~~~~ In file included from animation.h:4:0, from animation.cpp:3: renderer.h:216:33: error: expected unqualified-id before ',' token array>, 2> renderList; ^ make[1]: *** [Makefile:112: obj-opt/animation.o] Error 1 g++ -MMD -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -c campaign_builder.cpp -o obj-opt/campaign_builder.o In file included from campaign_builder.cpp:1:0: stdafx.h:115:12: error: 'std::function' has not been declared using std::function; ^~~~~~~~ In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from campaign.h:3, from campaign_builder.h:3, from campaign_builder.cpp:2: ./debug.h:59:31: error: 'function' has not been declared static DebugOutput toString(function callback); ^~~~~~~~ ./debug.h:59:39: error: expected ',' or '...' before '<' token static DebugOutput toString(function callback); ^ ./debug.h:62:11: error: 'function' does not name a type; did you mean 'union'? typedef function LineEndFun; ^~~~~~~~ union ./debug.h:64:3: error: 'LineEndFun' does not name a type LineEndFun onLineEnd; ^~~~~~~~~~ ./debug.h:67:32: error: 'LineEndFun' has not been declared DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~~ ./debug.h: In constructor 'DebugOutput::DebugOutput(std::ostream&, int)': ./debug.h:67:58: error: class 'DebugOutput' does not have any field named 'onLineEnd' DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~ ./debug.h: In destructor 'DebugLog::Logger::~Logger()': ./debug.h:86:20: error: '__gnu_cxx::__alloc_traits >::value_type {aka class DebugOutput}' has no member named 'onLineEnd' outputs[i].onLineEnd(); ^~~~~~~~~ In file included from extern/variant_serialize.h:3:0, from serialization.h:37, from util.h:24, from campaign.h:3, from campaign_builder.h:3, from campaign_builder.cpp:2: extern/variant.h: In lambda function: extern/variant.h:406:99: error: expected '(' before '>' token typename std::remove_const::type>::type>() == o1; } ); ^ extern/variant.h:406:101: error: expected primary-expression before ')' token typename std::remove_const::type>::type>() == o1; } ); ^ In file included from campaign.h:3:0, from campaign_builder.h:3, from campaign_builder.cpp:2: util.h: At global scope: util.h:63:19: error: 'function' was not declared in this scope T lambdaConstruct(function fun) { ^~~~~~~~ util.h:63:19: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from campaign.h:3, from campaign_builder.h:3, from campaign_builder.cpp:2: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from campaign.h:3:0, from campaign_builder.h:3, from campaign_builder.cpp:2: util.h:63:28: error: expected primary-expression before 'void' T lambdaConstruct(function fun) { ^~~~ util.h:63:43: error: expected ';' before '{' token T lambdaConstruct(function fun) { ^ util.h:74:9: error: 'function' does not name a type; did you mean 'union'? typedef function ItemPredicate; ^~~~~~~~ union util.h:167:11: error: 'function' does not name a type; did you mean 'union'? typedef function LinearMap; ^~~~~~~~ union util.h:256:25: error: 'Vec2::LinearMap' has not been declared Rectangle apply(Vec2::LinearMap) const; ^~~~~~~~~ util.h:390:19: error: expected ')' before '<' token EnumMap(function f) { ^ util.h:794:53: error: 'function' has not been declared map > groupBy(const vector& values, function getKey) { ^~~~~~~~ util.h:794:61: error: expected ',' or '...' before '<' token map > groupBy(const vector& values, function getKey) { ^ util.h:904:1: error: 'function' does not name a type; did you mean 'union'? function alwaysTrue() { ^~~~~~~~ union util.h:909:1: error: 'function' does not name a type; did you mean 'union'? function alwaysFalse() { ^~~~~~~~ union util.h:914:1: error: 'function' does not name a type; did you mean 'union'? function andFun(function x, const function y) { ^~~~~~~~ union util.h:920:18: error: expected ')' before '<' token OnExit(function f) : fun(f) {} ^ util.h:925:3: error: 'function' does not name a type; did you mean 'union'? function fun; ^~~~~~~~ union util.h: In destructor 'OnExit::~OnExit()': util.h:922:15: error: 'fun' was not declared in this scope ~OnExit() { fun(); } ^~~ util.h: At global scope: util.h:1415:21: error: expected ')' before '<' token AsyncLoop(function init, function loop); ^ util.h:1416:21: error: expected ')' before '<' token AsyncLoop(function); ^ util.h:1427:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(void (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1432:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(Ret (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1437:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(void (*ptr) (Args...)) { ^~~~~~~~ union util.h:1442:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(Ret (*ptr) (Args...)) { ^~~~~~~~ union util.h:1447:31: error: expected ')' before '<' token ConstructorFunction(function inConstructor); ^ util.h:1451:30: error: expected ')' before '<' token DestructorFunction(function inDestructor); ^ util.h:1455:3: error: 'function' does not name a type; did you mean 'union'? function destFun; ^~~~~~~~ union In file included from campaign_builder.cpp:2:0: campaign_builder.h:13:43: error: 'function' has not been declared optional prepareCampaign(function(CampaignType)>, CampaignType defaultType); ^~~~~~~~ campaign_builder.h:13:51: error: expected ',' or '...' before '<' token optional prepareCampaign(function(CampaignType)>, CampaignType defaultType); ^ In file included from campaign_builder.cpp:3:0: options.h:84:11: error: 'function' does not name a type; did you mean 'union'? typedef function Trigger; ^~~~~~~~ union options.h:85:29: error: 'Trigger' has not been declared void addTrigger(OptionId, Trigger trigger); ^~~~~~~ In file included from user_input.h:23:0, from view.h:20, from campaign_builder.cpp:6: entity_set.h:45:3: error: 'ItemPredicate' does not name a type ItemPredicate containsPredicate() const; ^~~~~~~~~~~~~ In file included from campaign_builder.cpp:6:0: view.h:123:7: error: 'function' has not been declared function cancelFun = nullptr) = 0; ^~~~~~~~ view.h:123:15: error: expected ',' or '...' before '<' token function cancelFun = nullptr) = 0; ^ In file included from collective_config.h:22:0, from enemy_factory.h:5, from campaign_builder.cpp:7: position.h:67:26: error: 'function' has not been declared vector getItems(function predicate) const; ^~~~~~~~ position.h:67:34: error: expected ',' or '...' before '<' token vector getItems(function predicate) const; ^ In file included from enemy_factory.h:5:0, from campaign_builder.cpp:7: collective_config.h:54:9: error: 'function' does not name a type; did you mean 'union'? typedef function&(WConstCollective)> StorageDestinationFun; ^~~~~~~~ union collective_config.h:57:3: error: 'StorageDestinationFun' does not name a type StorageDestinationFun storageDestination; ^~~~~~~~~~~~~~~~~~~~~ collective_config.h:66:9: error: 'function' does not name a type; did you mean 'union'? typedef function CollectiveItemPredicate; ^~~~~~~~ union collective_config.h:70:3: error: 'CollectiveItemPredicate' does not name a type; did you mean 'CollectiveWarning'? CollectiveItemPredicate predicate; ^~~~~~~~~~~~~~~~~~~~~~~ CollectiveWarning collective_config.h:71:3: error: 'StorageDestinationFun' does not name a type StorageDestinationFun destinationFun; ^~~~~~~~~~~~~~~~~~~~~ collective_config.h:80:11: error: 'function' does not name a type; did you mean 'union'? typedef function UsagePredicate; ^~~~~~~~ union collective_config.h:81:11: error: 'function' does not name a type; did you mean 'union'? typedef function ActivePredicate; ^~~~~~~~ union collective_config.h:82:32: error: expected ')' before ',' token MinionTaskInfo(UsagePredicate, const string& description); ^ collective_config.h:83:32: error: expected ')' before ',' token MinionTaskInfo(UsagePredicate, ActivePredicate, const string& description); ^ collective_config.h:85:3: error: 'UsagePredicate' does not name a type UsagePredicate furniturePredicate; ^~~~~~~~~~~~~~ collective_config.h:86:3: error: 'ActivePredicate' does not name a type ActivePredicate activePredicate = [](WConstCollective, FurnitureType) { return true; }; ^~~~~~~~~~~~~~~ In file included from creature.h:20:0, from campaign_builder.cpp:9: creature_action.h:9:11: error: 'function' does not name a type; did you mean 'union'? typedef function ActionFun; ^~~~~~~~ union creature_action.h:11:34: error: 'ActionFun' has not been declared CreatureAction(WConstCreature, ActionFun); ^~~~~~~~~ creature_action.h:13:26: error: 'ActionFun' has not been declared CreatureAction prepend(ActionFun); ^~~~~~~~~ creature_action.h:14:25: error: 'ActionFun' has not been declared CreatureAction append(ActionFun); ^~~~~~~~~ creature_action.h:20:3: error: 'ActionFun' does not name a type ActionFun action; ^~~~~~~~~ campaign_builder.cpp:321:3: error: 'function' does not name a type; did you mean 'union'? function xPredicate; ^~~~~~~~ union campaign_builder.cpp: In member function 'void CampaignBuilder::placeVillains(Campaign&, vector >, const VillainPlacement&, int)': campaign_builder.cpp:332:80: error: 'const struct VillainPlacement' has no member named 'xPredicate' if (!campaign.sites[v].blocked && campaign.sites[v].isEmpty() && placement.xPredicate(v.x)) ^~~~~~~~~~ campaign_builder.cpp: In member function 'VillainPlacement CampaignBuilder::getVillainPlacement(const Campaign&, VillainType)': campaign_builder.cpp:342:113: error: too many initializers for 'VillainPlacement' VillainPlacement ret { [&campaign](int x) { return campaign.sites.getBounds().getXRange().contains(x);}, none }; ^ campaign_builder.cpp:342:113: error: could not convert 'CampaignBuilder::getVillainPlacement(const Campaign&, VillainType)::{(* & campaign)}' from 'CampaignBuilder::getVillainPlacement(const Campaign&, VillainType)::' to 'std::experimental::optional' campaign_builder.cpp:348:15: error: 'struct VillainPlacement' has no member named 'xPredicate' ret.xPredicate = [](int x) { return x >= 5 && x < 12; }; ^~~~~~~~~~ campaign_builder.cpp:351:15: error: 'struct VillainPlacement' has no member named 'xPredicate' ret.xPredicate = [](int x) { return (x >= 1 && x < 5) || (x >= 12 && x < 16) ; }; ^~~~~~~~~~ campaign_builder.cpp: At global scope: campaign_builder.cpp:412:58: error: 'std::experimental::optional CampaignBuilder::prepareCampaign' is not a static data member of 'class CampaignBuilder' optional CampaignBuilder::prepareCampaign(function(CampaignType)> genRetired, ^~~~~~~~ campaign_builder.cpp:412:58: error: 'function' was not declared in this scope campaign_builder.cpp:412:58: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from campaign.h:3, from campaign_builder.h:3, from campaign_builder.cpp:2: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ campaign_builder.cpp:412:89: error: expected primary-expression before '(' token optional CampaignBuilder::prepareCampaign(function(CampaignType)> genRetired, ^ campaign_builder.cpp:412:102: error: expected primary-expression before ')' token optional CampaignBuilder::prepareCampaign(function(CampaignType)> genRetired, ^ campaign_builder.cpp:412:105: error: 'genRetired' was not declared in this scope optional CampaignBuilder::prepareCampaign(function(CampaignType)> genRetired, ^~~~~~~~~~ campaign_builder.cpp:412:105: note: suggested alternative: 'getitimer' optional CampaignBuilder::prepareCampaign(function(CampaignType)> genRetired, ^~~~~~~~~~ getitimer campaign_builder.cpp:413:18: error: expected primary-expression before 'type' CampaignType type) { ^~~~ campaign_builder.cpp:413:24: error: expected ',' or ';' before '{' token CampaignType type) { ^ In file included from util.h:19:0, from campaign.h:3, from campaign_builder.h:3, from campaign_builder.cpp:2: my_containers.h: In instantiation of 'vector::Iterator vector::Iterator::operator++(int) const [with BaseIterator = venum::EnumT*; T = venum::EnumT]': /usr/include/c++/7.2.2/bits/stl_algo.h:3830:22: required from 'void std::shuffle(_RAIter, _RAIter, _UGenerator&&) [with _RAIter = vector >::Iterator*>; _UGenerator = std::linear_congruential_engine&]' util.h:535:17: required from 'void RandomGen::shuffle(Iterator, Iterator) [with Iterator = vector >::Iterator*>]' campaign_builder.cpp:327:50: required from here my_containers.h:309:25: error: increment of member 'vector >::Iterator*>::it' in read-only object return Iterator(it++, parent); ~~^~ my_containers.h: In instantiation of 'vector::Iterator vector::Iterator::operator++(int) const [with BaseIterator = Vec2*; T = Vec2]': /usr/include/c++/7.2.2/bits/stl_algo.h:3830:22: required from 'void std::shuffle(_RAIter, _RAIter, _UGenerator&&) [with _RAIter = vector::Iterator; _UGenerator = std::linear_congruential_engine&]' util.h:529:17: required from 'vector RandomGen::permutation(vector) [with T = Vec2]' campaign_builder.cpp:334:39: required from here my_containers.h:309:25: error: increment of member 'vector::Iterator::it' in read-only object my_containers.h: In instantiation of 'vector::Iterator vector::Iterator::operator++(int) const [with BaseIterator = Campaign::VillainInfo*; T = Campaign::VillainInfo]': /usr/include/c++/7.2.2/bits/stl_algo.h:3830:22: required from 'void std::shuffle(_RAIter, _RAIter, _UGenerator&&) [with _RAIter = vector::Iterator; _UGenerator = std::linear_congruential_engine&]' util.h:535:17: required from 'void RandomGen::shuffle(Iterator, Iterator) [with Iterator = vector::Iterator]' campaign_builder.cpp:371:3: required from 'vector > shuffle(RandomGen&, vector) [with T = Campaign::VillainInfo]' campaign_builder.cpp:378:60: required from here my_containers.h:309:25: error: increment of member 'vector::Iterator::it' in read-only object make[1]: *** [Makefile:112: obj-opt/campaign_builder.o] Error 1 g++ -MMD -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -c bucket_map.cpp -o obj-opt/bucket_map.o In file included from bucket_map.cpp:1:0: stdafx.h:115:12: error: 'std::function' has not been declared using std::function; ^~~~~~~~ In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from bucket_map.h:3, from bucket_map.cpp:2: ./debug.h:59:31: error: 'function' has not been declared static DebugOutput toString(function callback); ^~~~~~~~ ./debug.h:59:39: error: expected ',' or '...' before '<' token static DebugOutput toString(function callback); ^ ./debug.h:62:11: error: 'function' does not name a type; did you mean 'union'? typedef function LineEndFun; ^~~~~~~~ union ./debug.h:64:3: error: 'LineEndFun' does not name a type LineEndFun onLineEnd; ^~~~~~~~~~ ./debug.h:67:32: error: 'LineEndFun' has not been declared DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~~ ./debug.h: In constructor 'DebugOutput::DebugOutput(std::ostream&, int)': ./debug.h:67:58: error: class 'DebugOutput' does not have any field named 'onLineEnd' DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~ ./debug.h: In destructor 'DebugLog::Logger::~Logger()': ./debug.h:86:20: error: '__gnu_cxx::__alloc_traits >::value_type {aka class DebugOutput}' has no member named 'onLineEnd' outputs[i].onLineEnd(); ^~~~~~~~~ In file included from extern/variant_serialize.h:3:0, from serialization.h:37, from util.h:24, from bucket_map.h:3, from bucket_map.cpp:2: extern/variant.h: In lambda function: extern/variant.h:406:99: error: expected '(' before '>' token typename std::remove_const::type>::type>() == o1; } ); ^ extern/variant.h:406:101: error: expected primary-expression before ')' token typename std::remove_const::type>::type>() == o1; } ); ^ In file included from bucket_map.h:3:0, from bucket_map.cpp:2: util.h: At global scope: util.h:63:19: error: 'function' was not declared in this scope T lambdaConstruct(function fun) { ^~~~~~~~ util.h:63:19: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from bucket_map.h:3, from bucket_map.cpp:2: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from bucket_map.h:3:0, from bucket_map.cpp:2: util.h:63:28: error: expected primary-expression before 'void' T lambdaConstruct(function fun) { ^~~~ util.h:63:43: error: expected ';' before '{' token T lambdaConstruct(function fun) { ^ util.h:74:9: error: 'function' does not name a type; did you mean 'union'? typedef function ItemPredicate; ^~~~~~~~ union util.h:167:11: error: 'function' does not name a type; did you mean 'union'? typedef function LinearMap; ^~~~~~~~ union util.h:256:25: error: 'Vec2::LinearMap' has not been declared Rectangle apply(Vec2::LinearMap) const; ^~~~~~~~~ util.h:390:19: error: expected ')' before '<' token EnumMap(function f) { ^ util.h:794:53: error: 'function' has not been declared map > groupBy(const vector& values, function getKey) { ^~~~~~~~ util.h:794:61: error: expected ',' or '...' before '<' token map > groupBy(const vector& values, function getKey) { ^ util.h:904:1: error: 'function' does not name a type; did you mean 'union'? function alwaysTrue() { ^~~~~~~~ union util.h:909:1: error: 'function' does not name a type; did you mean 'union'? function alwaysFalse() { ^~~~~~~~ union util.h:914:1: error: 'function' does not name a type; did you mean 'union'? function andFun(function x, const function y) { ^~~~~~~~ union util.h:920:18: error: expected ')' before '<' token OnExit(function f) : fun(f) {} ^ util.h:925:3: error: 'function' does not name a type; did you mean 'union'? function fun; ^~~~~~~~ union util.h: In destructor 'OnExit::~OnExit()': util.h:922:15: error: 'fun' was not declared in this scope ~OnExit() { fun(); } ^~~ util.h: At global scope: util.h:1415:21: error: expected ')' before '<' token AsyncLoop(function init, function loop); ^ util.h:1416:21: error: expected ')' before '<' token AsyncLoop(function); ^ util.h:1427:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(void (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1432:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(Ret (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1437:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(void (*ptr) (Args...)) { ^~~~~~~~ union util.h:1442:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(Ret (*ptr) (Args...)) { ^~~~~~~~ union util.h:1447:31: error: expected ')' before '<' token ConstructorFunction(function inConstructor); ^ util.h:1451:30: error: expected ')' before '<' token DestructorFunction(function inDestructor); ^ util.h:1455:3: error: 'function' does not name a type; did you mean 'union'? function destFun; ^~~~~~~~ union In file included from bucket_map.h:4:0, from bucket_map.cpp:2: entity_set.h:45:3: error: 'ItemPredicate' does not name a type ItemPredicate containsPredicate() const; ^~~~~~~~~~~~~ In file included from creature.h:20:0, from bucket_map.cpp:3: creature_action.h:9:11: error: 'function' does not name a type; did you mean 'union'? typedef function ActionFun; ^~~~~~~~ union creature_action.h:11:34: error: 'ActionFun' has not been declared CreatureAction(WConstCreature, ActionFun); ^~~~~~~~~ creature_action.h:13:26: error: 'ActionFun' has not been declared CreatureAction prepend(ActionFun); ^~~~~~~~~ creature_action.h:14:25: error: 'ActionFun' has not been declared CreatureAction append(ActionFun); ^~~~~~~~~ creature_action.h:20:3: error: 'ActionFun' does not name a type ActionFun action; ^~~~~~~~~ In file included from creature.h:23:0, from bucket_map.cpp:3: position.h:67:26: error: 'function' has not been declared vector getItems(function predicate) const; ^~~~~~~~ position.h:67:34: error: expected ',' or '...' before '<' token vector getItems(function predicate) const; ^ make[1]: *** [Makefile:112: obj-opt/bucket_map.o] Error 1 g++ -MMD -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -c campaign.cpp -o obj-opt/campaign.o In file included from campaign.cpp:1:0: stdafx.h:115:12: error: 'std::function' has not been declared using std::function; ^~~~~~~~ In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from campaign.h:3, from campaign.cpp:2: ./debug.h:59:31: error: 'function' has not been declared static DebugOutput toString(function callback); ^~~~~~~~ ./debug.h:59:39: error: expected ',' or '...' before '<' token static DebugOutput toString(function callback); ^ ./debug.h:62:11: error: 'function' does not name a type; did you mean 'union'? typedef function LineEndFun; ^~~~~~~~ union ./debug.h:64:3: error: 'LineEndFun' does not name a type LineEndFun onLineEnd; ^~~~~~~~~~ ./debug.h:67:32: error: 'LineEndFun' has not been declared DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~~ ./debug.h: In constructor 'DebugOutput::DebugOutput(std::ostream&, int)': ./debug.h:67:58: error: class 'DebugOutput' does not have any field named 'onLineEnd' DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~ ./debug.h: In destructor 'DebugLog::Logger::~Logger()': ./debug.h:86:20: error: '__gnu_cxx::__alloc_traits >::value_type {aka class DebugOutput}' has no member named 'onLineEnd' outputs[i].onLineEnd(); ^~~~~~~~~ In file included from extern/variant_serialize.h:3:0, from serialization.h:37, from util.h:24, from campaign.h:3, from campaign.cpp:2: extern/variant.h: In lambda function: extern/variant.h:406:99: error: expected '(' before '>' token typename std::remove_const::type>::type>() == o1; } ); ^ extern/variant.h:406:101: error: expected primary-expression before ')' token typename std::remove_const::type>::type>() == o1; } ); ^ In file included from campaign.h:3:0, from campaign.cpp:2: util.h: At global scope: util.h:63:19: error: 'function' was not declared in this scope T lambdaConstruct(function fun) { ^~~~~~~~ util.h:63:19: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from campaign.h:3, from campaign.cpp:2: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from campaign.h:3:0, from campaign.cpp:2: util.h:63:28: error: expected primary-expression before 'void' T lambdaConstruct(function fun) { ^~~~ util.h:63:43: error: expected ';' before '{' token T lambdaConstruct(function fun) { ^ util.h:74:9: error: 'function' does not name a type; did you mean 'union'? typedef function ItemPredicate; ^~~~~~~~ union util.h:167:11: error: 'function' does not name a type; did you mean 'union'? typedef function LinearMap; ^~~~~~~~ union util.h:256:25: error: 'Vec2::LinearMap' has not been declared Rectangle apply(Vec2::LinearMap) const; ^~~~~~~~~ util.h:390:19: error: expected ')' before '<' token EnumMap(function f) { ^ util.h:794:53: error: 'function' has not been declared map > groupBy(const vector& values, function getKey) { ^~~~~~~~ util.h:794:61: error: expected ',' or '...' before '<' token map > groupBy(const vector& values, function getKey) { ^ util.h:904:1: error: 'function' does not name a type; did you mean 'union'? function alwaysTrue() { ^~~~~~~~ union util.h:909:1: error: 'function' does not name a type; did you mean 'union'? function alwaysFalse() { ^~~~~~~~ union util.h:914:1: error: 'function' does not name a type; did you mean 'union'? function andFun(function x, const function y) { ^~~~~~~~ union util.h:920:18: error: expected ')' before '<' token OnExit(function f) : fun(f) {} ^ util.h:925:3: error: 'function' does not name a type; did you mean 'union'? function fun; ^~~~~~~~ union util.h: In destructor 'OnExit::~OnExit()': util.h:922:15: error: 'fun' was not declared in this scope ~OnExit() { fun(); } ^~~ util.h: At global scope: util.h:1415:21: error: expected ')' before '<' token AsyncLoop(function init, function loop); ^ util.h:1416:21: error: expected ')' before '<' token AsyncLoop(function); ^ util.h:1427:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(void (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1432:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(Ret (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1437:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(void (*ptr) (Args...)) { ^~~~~~~~ union util.h:1442:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(Ret (*ptr) (Args...)) { ^~~~~~~~ union util.h:1447:31: error: expected ')' before '<' token ConstructorFunction(function inConstructor); ^ util.h:1451:30: error: expected ')' before '<' token DestructorFunction(function inDestructor); ^ util.h:1455:3: error: 'function' does not name a type; did you mean 'union'? function destFun; ^~~~~~~~ union In file included from map_memory.h:19:0, from model.h:19, from campaign.cpp:4: position.h:67:26: error: 'function' has not been declared vector getItems(function predicate) const; ^~~~~~~~ position.h:67:34: error: expected ',' or '...' before '<' token vector getItems(function predicate) const; ^ make[1]: *** [Makefile:112: obj-opt/campaign.o] Error 1 g++ -MMD -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -c body.cpp -o obj-opt/body.o In file included from body.cpp:1:0: stdafx.h:115:12: error: 'std::function' has not been declared using std::function; ^~~~~~~~ In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from body.h:3, from body.cpp:2: ./debug.h:59:31: error: 'function' has not been declared static DebugOutput toString(function callback); ^~~~~~~~ ./debug.h:59:39: error: expected ',' or '...' before '<' token static DebugOutput toString(function callback); ^ ./debug.h:62:11: error: 'function' does not name a type; did you mean 'union'? typedef function LineEndFun; ^~~~~~~~ union ./debug.h:64:3: error: 'LineEndFun' does not name a type LineEndFun onLineEnd; ^~~~~~~~~~ ./debug.h:67:32: error: 'LineEndFun' has not been declared DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~~ ./debug.h: In constructor 'DebugOutput::DebugOutput(std::ostream&, int)': ./debug.h:67:58: error: class 'DebugOutput' does not have any field named 'onLineEnd' DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~ ./debug.h: In destructor 'DebugLog::Logger::~Logger()': ./debug.h:86:20: error: '__gnu_cxx::__alloc_traits >::value_type {aka class DebugOutput}' has no member named 'onLineEnd' outputs[i].onLineEnd(); ^~~~~~~~~ In file included from extern/variant_serialize.h:3:0, from serialization.h:37, from util.h:24, from body.h:3, from body.cpp:2: extern/variant.h: In lambda function: extern/variant.h:406:99: error: expected '(' before '>' token typename std::remove_const::type>::type>() == o1; } ); ^ extern/variant.h:406:101: error: expected primary-expression before ')' token typename std::remove_const::type>::type>() == o1; } ); ^ In file included from body.h:3:0, from body.cpp:2: util.h: At global scope: util.h:63:19: error: 'function' was not declared in this scope T lambdaConstruct(function fun) { ^~~~~~~~ util.h:63:19: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from body.h:3, from body.cpp:2: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from body.h:3:0, from body.cpp:2: util.h:63:28: error: expected primary-expression before 'void' T lambdaConstruct(function fun) { ^~~~ util.h:63:43: error: expected ';' before '{' token T lambdaConstruct(function fun) { ^ util.h:74:9: error: 'function' does not name a type; did you mean 'union'? typedef function ItemPredicate; ^~~~~~~~ union util.h:167:11: error: 'function' does not name a type; did you mean 'union'? typedef function LinearMap; ^~~~~~~~ union util.h:256:25: error: 'Vec2::LinearMap' has not been declared Rectangle apply(Vec2::LinearMap) const; ^~~~~~~~~ util.h:390:19: error: expected ')' before '<' token EnumMap(function f) { ^ util.h:794:53: error: 'function' has not been declared map > groupBy(const vector& values, function getKey) { ^~~~~~~~ util.h:794:61: error: expected ',' or '...' before '<' token map > groupBy(const vector& values, function getKey) { ^ util.h:904:1: error: 'function' does not name a type; did you mean 'union'? function alwaysTrue() { ^~~~~~~~ union util.h:909:1: error: 'function' does not name a type; did you mean 'union'? function alwaysFalse() { ^~~~~~~~ union util.h:914:1: error: 'function' does not name a type; did you mean 'union'? function andFun(function x, const function y) { ^~~~~~~~ union util.h:920:18: error: expected ')' before '<' token OnExit(function f) : fun(f) {} ^ util.h:925:3: error: 'function' does not name a type; did you mean 'union'? function fun; ^~~~~~~~ union util.h: In destructor 'OnExit::~OnExit()': util.h:922:15: error: 'fun' was not declared in this scope ~OnExit() { fun(); } ^~~ util.h: At global scope: util.h:1415:21: error: expected ')' before '<' token AsyncLoop(function init, function loop); ^ util.h:1416:21: error: expected ')' before '<' token AsyncLoop(function); ^ util.h:1427:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(void (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1432:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(Ret (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1437:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(void (*ptr) (Args...)) { ^~~~~~~~ union util.h:1442:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(Ret (*ptr) (Args...)) { ^~~~~~~~ union util.h:1447:31: error: expected ')' before '<' token ConstructorFunction(function inConstructor); ^ util.h:1451:30: error: expected ')' before '<' token DestructorFunction(function inDestructor); ^ util.h:1455:3: error: 'function' does not name a type; did you mean 'union'? function destFun; ^~~~~~~~ union In file included from body.h:5:0, from body.cpp:2: position.h:67:26: error: 'function' has not been declared vector getItems(function predicate) const; ^~~~~~~~ position.h:67:34: error: expected ',' or '...' before '<' token vector getItems(function predicate) const; ^ In file included from creature.h:20:0, from body.cpp:6: creature_action.h:9:11: error: 'function' does not name a type; did you mean 'union'? typedef function ActionFun; ^~~~~~~~ union creature_action.h:11:34: error: 'ActionFun' has not been declared CreatureAction(WConstCreature, ActionFun); ^~~~~~~~~ creature_action.h:13:26: error: 'ActionFun' has not been declared CreatureAction prepend(ActionFun); ^~~~~~~~~ creature_action.h:14:25: error: 'ActionFun' has not been declared CreatureAction append(ActionFun); ^~~~~~~~~ creature_action.h:20:3: error: 'ActionFun' does not name a type ActionFun action; ^~~~~~~~~ In file included from creature.h:25:0, from body.cpp:6: entity_set.h:45:3: error: 'ItemPredicate' does not name a type ItemPredicate containsPredicate() const; ^~~~~~~~~~~~~ In file included from body.cpp:10:0: creature_attributes.h:48:30: error: expected ')' before '<' token CreatureAttributes(function); ^ In file included from body.cpp:17:0: item.h:95:10: error: 'ItemPredicate' does not name a type; did you mean 'ItemAttributes'? static ItemPredicate effectPredicate(EffectType); ^~~~~~~~~~~~~ ItemAttributes item.h:96:10: error: 'ItemPredicate' does not name a type; did you mean 'ItemAttributes'? static ItemPredicate classPredicate(ItemClass); ^~~~~~~~~~~~~ ItemAttributes item.h:97:10: error: 'ItemPredicate' does not name a type; did you mean 'ItemAttributes'? static ItemPredicate equipmentSlotPredicate(EquipmentSlot); ^~~~~~~~~~~~~ ItemAttributes item.h:98:10: error: 'ItemPredicate' does not name a type; did you mean 'ItemAttributes'? static ItemPredicate classPredicate(vector); ^~~~~~~~~~~~~ ItemAttributes item.h:99:10: error: 'ItemPredicate' does not name a type; did you mean 'ItemAttributes'? static ItemPredicate namePredicate(const string& name); ^~~~~~~~~~~~~ ItemAttributes item.h:100:10: error: 'ItemPredicate' does not name a type; did you mean 'ItemAttributes'? static ItemPredicate isRangedWeaponPredicate(); ^~~~~~~~~~~~~ ItemAttributes item.h:103:7: error: 'function' has not been declared function addSuffix = [](const WItem) { return ""; }); ^~~~~~~~ item.h:103:15: error: expected ',' or '...' before '<' token function addSuffix = [](const WItem) { return ""; }); ^ make[1]: *** [Makefile:112: obj-opt/body.o] Error 1 g++ -MMD -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -std=c++1y -DDATA_DIR=\"/usr/share/games/keeperrl\" -DRELEASE -O3 -I. -I./extern -c main.cpp -o obj-opt/main.o In file included from main.cpp:16:0: stdafx.h:115:12: error: 'std::function' has not been declared using std::function; ^~~~~~~~ In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from view.h:18, from main.cpp:26: ./debug.h:59:31: error: 'function' has not been declared static DebugOutput toString(function callback); ^~~~~~~~ ./debug.h:59:39: error: expected ',' or '...' before '<' token static DebugOutput toString(function callback); ^ ./debug.h:62:11: error: 'function' does not name a type; did you mean 'union'? typedef function LineEndFun; ^~~~~~~~ union ./debug.h:64:3: error: 'LineEndFun' does not name a type LineEndFun onLineEnd; ^~~~~~~~~~ ./debug.h:67:32: error: 'LineEndFun' has not been declared DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~~ ./debug.h: In constructor 'DebugOutput::DebugOutput(std::ostream&, int)': ./debug.h:67:58: error: class 'DebugOutput' does not have any field named 'onLineEnd' DebugOutput(std::ostream& o, LineEndFun end) : out(o), onLineEnd(end) {} ^~~~~~~~~ ./debug.h: In destructor 'DebugLog::Logger::~Logger()': ./debug.h:86:20: error: '__gnu_cxx::__alloc_traits >::value_type {aka class DebugOutput}' has no member named 'onLineEnd' outputs[i].onLineEnd(); ^~~~~~~~~ In file included from extern/variant_serialize.h:3:0, from serialization.h:37, from util.h:24, from view.h:18, from main.cpp:26: extern/variant.h: In lambda function: extern/variant.h:406:99: error: expected '(' before '>' token typename std::remove_const::type>::type>() == o1; } ); ^ extern/variant.h:406:101: error: expected primary-expression before ')' token typename std::remove_const::type>::type>() == o1; } ); ^ In file included from view.h:18:0, from main.cpp:26: util.h: At global scope: util.h:63:19: error: 'function' was not declared in this scope T lambdaConstruct(function fun) { ^~~~~~~~ util.h:63:19: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from view.h:18, from main.cpp:26: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from view.h:18:0, from main.cpp:26: util.h:63:28: error: expected primary-expression before 'void' T lambdaConstruct(function fun) { ^~~~ util.h:63:43: error: expected ';' before '{' token T lambdaConstruct(function fun) { ^ util.h:74:9: error: 'function' does not name a type; did you mean 'union'? typedef function ItemPredicate; ^~~~~~~~ union util.h:167:11: error: 'function' does not name a type; did you mean 'union'? typedef function LinearMap; ^~~~~~~~ union util.h:256:25: error: 'Vec2::LinearMap' has not been declared Rectangle apply(Vec2::LinearMap) const; ^~~~~~~~~ util.h:390:19: error: expected ')' before '<' token EnumMap(function f) { ^ util.h:794:53: error: 'function' has not been declared map > groupBy(const vector& values, function getKey) { ^~~~~~~~ util.h:794:61: error: expected ',' or '...' before '<' token map > groupBy(const vector& values, function getKey) { ^ util.h:904:1: error: 'function' does not name a type; did you mean 'union'? function alwaysTrue() { ^~~~~~~~ union util.h:909:1: error: 'function' does not name a type; did you mean 'union'? function alwaysFalse() { ^~~~~~~~ union util.h:914:1: error: 'function' does not name a type; did you mean 'union'? function andFun(function x, const function y) { ^~~~~~~~ union util.h:920:18: error: expected ')' before '<' token OnExit(function f) : fun(f) {} ^ util.h:925:3: error: 'function' does not name a type; did you mean 'union'? function fun; ^~~~~~~~ union util.h: In destructor 'OnExit::~OnExit()': util.h:922:15: error: 'fun' was not declared in this scope ~OnExit() { fun(); } ^~~ util.h: At global scope: util.h:1415:21: error: expected ')' before '<' token AsyncLoop(function init, function loop); ^ util.h:1416:21: error: expected ')' before '<' token AsyncLoop(function); ^ util.h:1427:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(void (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1432:1: error: 'function' does not name a type; did you mean 'union'? function bindMethod(Ret (T::*ptr) (Args...), T* t) { ^~~~~~~~ union util.h:1437:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(void (*ptr) (Args...)) { ^~~~~~~~ union util.h:1442:1: error: 'function' does not name a type; did you mean 'union'? function bindFunction(Ret (*ptr) (Args...)) { ^~~~~~~~ union util.h:1447:31: error: expected ')' before '<' token ConstructorFunction(function inConstructor); ^ util.h:1451:30: error: expected ')' before '<' token DestructorFunction(function inDestructor); ^ util.h:1455:3: error: 'function' does not name a type; did you mean 'union'? function destFun; ^~~~~~~~ union In file included from user_input.h:23:0, from view.h:20, from main.cpp:26: entity_set.h:45:3: error: 'ItemPredicate' does not name a type ItemPredicate containsPredicate() const; ^~~~~~~~~~~~~ In file included from main.cpp:26:0: view.h:123:7: error: 'function' has not been declared function cancelFun = nullptr) = 0; ^~~~~~~~ view.h:123:15: error: expected ',' or '...' before '<' token function cancelFun = nullptr) = 0; ^ In file included from main.cpp:27:0: options.h:84:11: error: 'function' does not name a type; did you mean 'union'? typedef function Trigger; ^~~~~~~~ union options.h:85:29: error: 'Trigger' has not been declared void addTrigger(OptionId, Trigger trigger); ^~~~~~~ In file included from tile.h:18:0, from main.cpp:31: renderer.h:212:22: error: 'function' has not been declared void addRenderElem(function); ^~~~~~~~ renderer.h:212:30: error: expected ',' or '...' before '<' token void addRenderElem(function); ^ renderer.h:216:16: error: 'function' was not declared in this scope array>, 2> renderList; ^~~~~~~~ renderer.h:216:16: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from view.h:18, from main.cpp:26: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from tile.h:18:0, from main.cpp:31: renderer.h:216:30: error: template argument 1 is invalid array>, 2> renderList; ^ renderer.h:216:31: error: wrong number of template arguments (1, should be 2) array>, 2> renderList; ^~ In file included from /usr/include/c++/7.2.2/tuple:39:0, from /usr/include/c++/7.2.2/bits/unique_ptr.h:37, from /usr/include/c++/7.2.2/memory:80, from stdafx.h:46, from main.cpp:16: /usr/include/c++/7.2.2/array:94:12: note: provided for 'template struct std::array' struct array ^~~~~ In file included from tile.h:18:0, from main.cpp:31: renderer.h:216:33: error: expected unqualified-id before ',' token array>, 2> renderList; ^ In file included from gui_builder.h:20:0, from window_view.h:23, from main.cpp:33: gui_elem.h:73:19: error: 'function' has not been declared SGuiElem button(function, SDL::SDL_Keysym, bool capture = false); ^~~~~~~~ gui_elem.h:73:27: error: expected ',' or '...' before '<' token SGuiElem button(function, SDL::SDL_Keysym, bool capture = false); ^ gui_elem.h:74:23: error: 'function' has not been declared SGuiElem buttonChar(function, char, bool capture = false, bool useAltIfWasdScrolling = false); ^~~~~~~~ gui_elem.h:74:31: error: expected ',' or '...' before '<' token SGuiElem buttonChar(function, char, bool capture = false, bool useAltIfWasdScrolling = false); ^ gui_elem.h:75:19: error: 'function' has not been declared SGuiElem button(function); ^~~~~~~~ gui_elem.h:75:27: error: expected ',' or '...' before '<' token SGuiElem button(function); ^ gui_elem.h:75:12: error: 'SGuiElem GuiFactory::button(int)' cannot be overloaded SGuiElem button(function); ^~~~~~ gui_elem.h:73:12: error: with 'SGuiElem GuiFactory::button(int)' SGuiElem button(function, SDL::SDL_Keysym, bool capture = false); ^~~~~~ gui_elem.h:76:29: error: 'function' has not been declared SGuiElem buttonRightClick(function); ^~~~~~~~ gui_elem.h:76:37: error: expected ',' or '...' before '<' token SGuiElem buttonRightClick(function); ^ gui_elem.h:77:26: error: 'function' has not been declared SGuiElem reverseButton(function, vector = {}, bool capture = false); ^~~~~~~~ gui_elem.h:77:34: error: expected ',' or '...' before '<' token SGuiElem reverseButton(function, vector = {}, bool capture = false); ^ gui_elem.h:78:23: error: 'function' has not been declared SGuiElem buttonRect(function, SDL::SDL_Keysym, bool capture = false); ^~~~~~~~ gui_elem.h:78:31: error: expected ',' or '...' before '<' token SGuiElem buttonRect(function, SDL::SDL_Keysym, bool capture = false); ^ gui_elem.h:79:23: error: 'function' has not been declared SGuiElem buttonRect(function); ^~~~~~~~ gui_elem.h:79:31: error: expected ',' or '...' before '<' token SGuiElem buttonRect(function); ^ gui_elem.h:79:12: error: 'SGuiElem GuiFactory::buttonRect(int)' cannot be overloaded SGuiElem buttonRect(function); ^~~~~~~~~~ gui_elem.h:78:12: error: with 'SGuiElem GuiFactory::buttonRect(int)' SGuiElem buttonRect(function, SDL::SDL_Keysym, bool capture = false); ^~~~~~~~~~ gui_elem.h:80:30: error: 'function' has not been declared SGuiElem releaseLeftButton(function, optional = none); ^~~~~~~~ gui_elem.h:80:38: error: expected ',' or '...' before '<' token SGuiElem releaseLeftButton(function, optional = none); ^ gui_elem.h:81:31: error: 'function' has not been declared SGuiElem releaseRightButton(function); ^~~~~~~~ gui_elem.h:81:39: error: expected ',' or '...' before '<' token SGuiElem releaseRightButton(function); ^ gui_elem.h:84:23: error: 'function' has not been declared SGuiElem mouseWheel(function); ^~~~~~~~ gui_elem.h:84:31: error: expected ',' or '...' before '<' token SGuiElem mouseWheel(function); ^ gui_elem.h:85:23: error: 'function' has not been declared SGuiElem keyHandler(function, bool capture = false); ^~~~~~~~ gui_elem.h:85:31: error: expected ',' or '...' before '<' token SGuiElem keyHandler(function, bool capture = false); ^ gui_elem.h:86:23: error: 'function' has not been declared SGuiElem keyHandler(function, Keybinding, bool capture = false); ^~~~~~~~ gui_elem.h:86:31: error: expected ',' or '...' before '<' token SGuiElem keyHandler(function, Keybinding, bool capture = false); ^ gui_elem.h:86:12: error: 'SGuiElem GuiFactory::keyHandler(int)' cannot be overloaded SGuiElem keyHandler(function, Keybinding, bool capture = false); ^~~~~~~~~~ gui_elem.h:85:12: error: with 'SGuiElem GuiFactory::keyHandler(int)' SGuiElem keyHandler(function, bool capture = false); ^~~~~~~~~~ gui_elem.h:87:23: error: 'function' has not been declared SGuiElem keyHandler(function, vector, bool capture = false); ^~~~~~~~ gui_elem.h:87:31: error: expected ',' or '...' before '<' token SGuiElem keyHandler(function, vector, bool capture = false); ^ gui_elem.h:87:12: error: 'SGuiElem GuiFactory::keyHandler(int)' cannot be overloaded SGuiElem keyHandler(function, vector, bool capture = false); ^~~~~~~~~~ gui_elem.h:85:12: error: with 'SGuiElem GuiFactory::keyHandler(int)' SGuiElem keyHandler(function, bool capture = false); ^~~~~~~~~~ gui_elem.h:88:27: error: 'function' has not been declared SGuiElem keyHandlerChar(function, char, bool capture = false, bool useAltIfWasdScrolling = false); ^~~~~~~~ gui_elem.h:88:35: error: expected ',' or '...' before '<' token SGuiElem keyHandlerChar(function, char, bool capture = false, bool useAltIfWasdScrolling = false); ^ gui_elem.h:135:48: error: 'function' has not been declared SGuiElem margin(SGuiElem top, SGuiElem rest, function width, MarginType type); ^~~~~~~~ gui_elem.h:135:56: error: expected ',' or '...' before '<' token SGuiElem margin(SGuiElem top, SGuiElem rest, function width, MarginType type); ^ gui_elem.h:136:76: error: 'function' has not been declared SGuiElem maybeMargin(SGuiElem top, SGuiElem rest, int width, MarginType, function); ^~~~~~~~ gui_elem.h:136:84: error: expected ',' or '...' before '<' token SGuiElem maybeMargin(SGuiElem top, SGuiElem rest, int width, MarginType, function); ^ gui_elem.h:149:33: error: 'function' has not been declared SGuiElem label(const string&, function, char hotkey = 0); ^~~~~~~~ gui_elem.h:149:41: error: expected ',' or '...' before '<' token SGuiElem label(const string&, function, char hotkey = 0); ^ gui_elem.h:150:21: error: 'function' has not been declared SGuiElem labelFun(function, function); ^~~~~~~~ gui_elem.h:150:29: error: expected ',' or '...' before '<' token SGuiElem labelFun(function, function); ^ gui_elem.h:151:21: error: 'function' has not been declared SGuiElem labelFun(function, Color = Color::WHITE); ^~~~~~~~ gui_elem.h:151:29: error: expected ',' or '...' before '<' token SGuiElem labelFun(function, Color = Color::WHITE); ^ gui_elem.h:151:12: error: 'SGuiElem GuiFactory::labelFun(int)' cannot be overloaded SGuiElem labelFun(function, Color = Color::WHITE); ^~~~~~~~ gui_elem.h:150:12: error: with 'SGuiElem GuiFactory::labelFun(int)' SGuiElem labelFun(function, function); ^~~~~~~~ gui_elem.h:156:26: error: 'function' has not been declared SGuiElem variableLabel(function, int lineHeight, int size = Renderer::textSize, ^~~~~~~~ gui_elem.h:156:34: error: expected ',' or '...' before '<' token SGuiElem variableLabel(function, int lineHeight, int size = Renderer::textSize, ^ gui_elem.h:162:40: error: 'function' has not been declared SGuiElem labelUnicode(const string&, function, int size = Renderer::textSize, ^~~~~~~~ gui_elem.h:162:48: error: expected ',' or '...' before '<' token SGuiElem labelUnicode(const string&, function, int size = Renderer::textSize, ^ gui_elem.h:168:22: error: 'function' has not been declared SGuiElem translate(function, SGuiElem); ^~~~~~~~ gui_elem.h:168:30: error: expected ',' or '...' before '<' token SGuiElem translate(function, SGuiElem); ^ gui_elem.h:171:29: error: 'function' has not been declared SGuiElem onRenderedAction(function); ^~~~~~~~ gui_elem.h:171:37: error: expected ',' or '...' before '<' token SGuiElem onRenderedAction(function); ^ gui_elem.h:172:28: error: 'function' has not been declared SGuiElem mouseOverAction(function callback, function onLeaveCallback = nullptr); ^~~~~~~~ gui_elem.h:172:36: error: expected ',' or '...' before '<' token SGuiElem mouseOverAction(function callback, function onLeaveCallback = nullptr); ^ gui_elem.h:181:40: error: 'function' has not been declared SGuiElem conditional2(SGuiElem elem, function cond); ^~~~~~~~ gui_elem.h:181:48: error: expected ',' or '...' before '<' token SGuiElem conditional2(SGuiElem elem, function cond); ^ gui_elem.h:182:39: error: 'function' has not been declared SGuiElem conditional(SGuiElem elem, function cond); ^~~~~~~~ gui_elem.h:182:47: error: expected ',' or '...' before '<' token SGuiElem conditional(SGuiElem elem, function cond); ^ gui_elem.h:183:47: error: 'function' has not been declared SGuiElem conditionalStopKeys(SGuiElem elem, function cond); ^~~~~~~~ gui_elem.h:183:55: error: expected ',' or '...' before '<' token SGuiElem conditionalStopKeys(SGuiElem elem, function cond); ^ gui_elem.h:184:56: error: 'function' has not been declared SGuiElem conditional2(SGuiElem elem, SGuiElem alter, function cond); ^~~~~~~~ gui_elem.h:184:64: error: expected ',' or '...' before '<' token SGuiElem conditional2(SGuiElem elem, SGuiElem alter, function cond); ^ gui_elem.h:185:55: error: 'function' has not been declared SGuiElem conditional(SGuiElem elem, SGuiElem alter, function cond); ^~~~~~~~ gui_elem.h:185:63: error: expected ',' or '...' before '<' token SGuiElem conditional(SGuiElem elem, SGuiElem alter, function cond); ^ gui_elem.h:194:11: error: 'function' does not name a type; did you mean 'union'? typedef function PositionFun; ^~~~~~~~ union gui_elem.h:195:31: error: 'PositionFun' has not been declared SGuiElem tooltip2(SGuiElem, PositionFun); ^~~~~~~~~~~ gui_elem.h:200:36: error: 'function' has not been declared SGuiElem dragSource(DragContent, function); ^~~~~~~~ gui_elem.h:200:44: error: expected ',' or '...' before '<' token SGuiElem dragSource(DragContent, function); ^ gui_elem.h:201:25: error: 'function' has not been declared SGuiElem dragListener(function); ^~~~~~~~ gui_elem.h:201:33: error: expected ',' or '...' before '<' token SGuiElem dragListener(function); ^ gui_elem.h:251:37: error: 'function' has not been declared SGuiElem window(SGuiElem content, function onExitButton); ^~~~~~~~ gui_elem.h:251:45: error: expected ',' or '...' before '<' token SGuiElem window(SGuiElem content, function onExitButton); ^ gui_elem.h:253:41: error: 'function' has not been declared SGuiElem miniWindow(SGuiElem content, function onExitButton = nullptr, bool captureExitClick = false); ^~~~~~~~ gui_elem.h:253:49: error: expected ',' or '...' before '<' token SGuiElem miniWindow(SGuiElem content, function onExitButton = nullptr, bool captureExitClick = false); ^ gui_elem.h:254:42: error: 'function' has not been declared SGuiElem miniWindow2(SGuiElem content, function onExitButton = nullptr, bool captureExitClick = false); ^~~~~~~~ gui_elem.h:254:50: error: expected ',' or '...' before '<' token SGuiElem miniWindow2(SGuiElem content, function onExitButton = nullptr, bool captureExitClick = false); ^ gui_elem.h:296:35: error: 'function' has not been declared SGuiElem uiHighlightConditional(function, Color = Color::GREEN); ^~~~~~~~ gui_elem.h:296:43: error: expected ',' or '...' before '<' token SGuiElem uiHighlightConditional(function, Color = Color::GREEN); ^ In file included from player_message.h:5:0, from game_info.h:7, from gui_builder.h:21, from window_view.h:23, from main.cpp:33: position.h:67:26: error: 'function' has not been declared vector getItems(function predicate) const; ^~~~~~~~ position.h:67:34: error: expected ',' or '...' before '<' token vector getItems(function predicate) const; ^ In file included from window_view.h:23:0, from main.cpp:33: gui_builder.h:52:5: error: 'function' does not name a type; did you mean 'union'? function input; ^~~~~~~~ union gui_builder.h:53:5: error: 'function' does not name a type; did you mean 'union'? function&)> hint; ^~~~~~~~ union gui_builder.h:54:5: error: 'function' does not name a type; did you mean 'union'? function keyboard; ^~~~~~~~ union gui_builder.h:55:5: error: 'function' does not name a type; did you mean 'union'? function refreshScreen; ^~~~~~~~ union gui_builder.h:56:5: error: 'function' does not name a type; did you mean 'union'? function info; ^~~~~~~~ union gui_builder.h:86:11: error: 'function' does not name a type; did you mean 'union'? typedef function)> ItemMenuCallback; ^~~~~~~~ union gui_builder.h:87:58: error: 'ItemMenuCallback' has not been declared vector drawItemMenu(const vector&, ItemMenuCallback, bool doneBut = false); ^~~~~~~~~~~~~~~~ gui_builder.h:88:11: error: 'function' does not name a type; did you mean 'union'? typedef function::Id>)> CreatureMenuCallback; ^~~~~~~~ union gui_builder.h:134:73: error: 'function' has not been declared SGuiElem drawCampaignGrid(const Campaign&, optional* markedPos, function activeFun, ^~~~~~~~ gui_builder.h:134:81: error: expected ',' or '...' before '<' token SGuiElem drawCampaignGrid(const Campaign&, optional* markedPos, function activeFun, ^ gui_builder.h:164:3: error: 'function' does not name a type; did you mean 'union'? function getButtonCallback(UserInput); ^~~~~~~~ union gui_builder.h:172:26: error: 'function' has not been declared SGuiElem drawPlusMinus(function callback, bool canIncrease, bool canDecrease); ^~~~~~~~ gui_builder.h:172:34: error: expected ',' or '...' before '<' token SGuiElem drawPlusMinus(function callback, bool canIncrease, bool canDecrease); ^ gui_builder.h:173:47: error: 'function' has not been declared SGuiElem drawOptionElem(Options*, OptionId, function onChanged, optional defaultString); ^~~~~~~~ gui_builder.h:173:55: error: expected ',' or '...' before '<' token SGuiElem drawOptionElem(Options*, OptionId, function onChanged, optional defaultString); ^ gui_builder.h:174:59: error: 'function' has not been declared GuiFactory::ListBuilder drawRetiredGames(RetiredGames&, function reloadCampaign, optional maxActive); ^~~~~~~~ gui_builder.h:174:67: error: expected ',' or '...' before '<' token GuiFactory::ListBuilder drawRetiredGames(RetiredGames&, function reloadCampaign, optional maxActive); ^ gui_builder.h:235:41: error: 'function' has not been declared SGuiElem getItemLine(const ItemInfo&, function onClick, ^~~~~~~~ gui_builder.h:235:49: error: expected ',' or '...' before '<' token SGuiElem getItemLine(const ItemInfo&, function onClick, ^ In file included from main.cpp:33:0: window_view.h:52:79: error: 'function' has not been declared virtual void displaySplash(const ProgressMeter*, const string&, SplashType, function cancelFun) override; ^~~~~~~~ window_view.h:52:87: error: expected ',' or '...' before '<' token virtual void displaySplash(const ProgressMeter*, const string&, SplashType, function cancelFun) override; ^ window_view.h:127:63: error: 'function' has not been declared void getBigSplash(const ProgressMeter&, const string& text, function cancelFun); ^~~~~~~~ window_view.h:127:71: error: expected ',' or '...' before '<' token void getBigSplash(const ProgressMeter&, const string& text, function cancelFun); ^ window_view.h:128:43: error: 'function' has not been declared void getSmallSplash(const string& text, function cancelFun); ^~~~~~~~ window_view.h:128:51: error: expected ',' or '...' before '<' token void getSmallSplash(const string& text, function cancelFun); ^ window_view.h:169:3: error: 'function' does not name a type; did you mean 'union'? function getButtonCallback(UserInput); ^~~~~~~~ union window_view.h:177:9: error: 'function' was not declared in this scope stack> renderDialog; ^~~~~~~~ window_view.h:177:9: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from view.h:18, from main.cpp:26: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from main.cpp:33:0: window_view.h:177:23: error: template argument 1 is invalid stack> renderDialog; ^ window_view.h:177:23: error: template argument 2 is invalid window_view.h:177:24: error: expected unqualified-id before '>' token stack> renderDialog; ^~ window_view.h:179:22: error: 'function' has not been declared void addVoidDialog(function); ^~~~~~~~ window_view.h:179:30: error: expected ',' or '...' before '<' token void addVoidDialog(function); ^ window_view.h:182:41: error: 'function' has not been declared void addReturnDialog(SyncQueue& q, function fun) { ^~~~~~~~ window_view.h:182:49: error: expected ',' or '...' before '<' token void addReturnDialog(SyncQueue& q, function fun) { ^ window_view.h: In member function 'void WindowView::addReturnDialog(SyncQueue&, int)': window_view.h:183:5: error: 'renderDialog' was not declared in this scope renderDialog.push([&q, fun, this] { ^~~~~~~~~~~~ window_view.h:183:5: note: suggested alternative: 'renderer' renderDialog.push([&q, fun, this] { ^~~~~~~~~~~~ renderer window_view.h:183:28: error: 'fun' was not declared in this scope renderDialog.push([&q, fun, this] { ^~~ window_view.h: In lambda function: window_view.h:184:14: error: 'fun' is not captured q.push(fun()); ^~~ window_view.h:183:37: note: the lambda has no capture-default renderDialog.push([&q, fun, this] { ^ window_view.h:183:28: note: 'fun' declared here renderDialog.push([&q, fun, this] { ^~~ window_view.h:185:7: error: 'renderDialog' is not captured renderDialog.pop(); ^~~~~~~~~~~~ window_view.h:183:37: note: the lambda has no capture-default renderDialog.push([&q, fun, this] { ^ window_view.h:183:5: note: 'renderDialog' declared here renderDialog.push([&q, fun, this] { ^~~~~~~~~~~~ In file included from main.cpp:34:0: file_sharing.h: At global scope: file_sharing.h:45:13: error: 'function' was not declared in this scope SyncQueue> uploadQueue; ^~~~~~~~ file_sharing.h:45:13: note: suggested alternative: In file included from /usr/include/c++/7.2.2/functional:58:0, from extern/optional.h:17, from my_containers.h:6, from util.h:19, from view.h:18, from main.cpp:26: /usr/include/c++/7.2.2/bits/std_function.h:147:11: note: 'std::function' class function; ^~~~~~~~ In file included from main.cpp:34:0: file_sharing.h:45:27: error: template argument 1 is invalid SyncQueue> uploadQueue; ^ file_sharing.h:45:28: error: expected unqualified-id before '>' token SyncQueue> uploadQueue; ^~ In file included from main.cpp:36:0: main_loop.h:48:72: error: 'function' has not been declared void doWithSplash(SplashType, const string& text, int totalProgress, function fun, ^~~~~~~~ main_loop.h:48:80: error: expected ',' or '...' before '<' token void doWithSplash(SplashType, const string& text, int totalProgress, function fun, ^ main_loop.h:51:53: error: 'function' has not been declared void doWithSplash(SplashType, const string& text, function fun, function cancelFun = nullptr); ^~~~~~~~ main_loop.h:51:61: error: expected ',' or '...' before '<' token void doWithSplash(SplashType, const string& text, function fun, function cancelFun = nullptr); ^ In file included from move_info.h:3:0, from collective_control.h:3, from village_control.h:18, from model_builder.h:3, from main.cpp:42: creature_action.h:9:11: error: 'function' does not name a type; did you mean 'union'? typedef function ActionFun; ^~~~~~~~ union creature_action.h:11:34: error: 'ActionFun' has not been declared CreatureAction(WConstCreature, ActionFun); ^~~~~~~~~ creature_action.h:13:26: error: 'ActionFun' has not been declared CreatureAction prepend(ActionFun); ^~~~~~~~~ creature_action.h:14:25: error: 'ActionFun' has not been declared CreatureAction append(ActionFun); ^~~~~~~~~ creature_action.h:20:3: error: 'ActionFun' does not name a type ActionFun action; ^~~~~~~~~ In file included from main.cpp:42:0: model_builder.h:27:63: error: 'function' has not been declared void measureModelGen(const std::string& name, int numTries, function genFun); ^~~~~~~~ model_builder.h:27:71: error: expected ',' or '...' before '<' token void measureModelGen(const std::string& name, int numTries, function genFun); ^ model_builder.h:48:36: error: 'function' has not been declared PModel tryBuilding(int numTries, function buildFun); ^~~~~~~~ model_builder.h:48:44: error: expected ',' or '...' before '<' token PModel tryBuilding(int numTries, function buildFun); ^ main.cpp: In function 'int keeperMain(po::parser&)': main.cpp:260:86: error: invalid user-defined conversion from 'keeperMain(po::parser&)::' to 'int' [-fpermissive] [](const string& s) { ofstream("stacktrace.out") << s << "\n" << std::flush; } )); ^ main.cpp:260:25: note: candidate is: keeperMain(po::parser&)::::operator void (*)(const string&)() const [](const string& s) { ofstream("stacktrace.out") << s << "\n" << std::flush; } )); ^ main.cpp:260:25: note: no known conversion from 'void (*)(const string&) {aka void (*)(const std::__cxx11::basic_string&)}' to 'int' In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from view.h:18, from main.cpp:26: ./debug.h:59:22: note: initializing argument 1 of 'static DebugOutput DebugOutput::toString(int)' static DebugOutput toString(function callback); ^~~~~~~~ main.cpp:351:98: error: no matching function for call to 'DebugOutput::toString(keeperMain(po::parser&)::)' FatalLog.addOutput(DebugOutput::toString([&renderer](const string& s) { renderer.showError(s);})); ^ In file included from extern/optional.h:16:0, from my_containers.h:6, from util.h:19, from view.h:18, from main.cpp:26: ./debug.h:59:22: note: candidate: static DebugOutput DebugOutput::toString(int) static DebugOutput toString(function callback); ^~~~~~~~ ./debug.h:59:22: note: no known conversion for argument 1 from 'keeperMain(po::parser&)::' to 'int' make[1]: *** [Makefile:112: obj-opt/main.o] Error 1 make: *** [Makefile:99: all] Error 2 error: Bad exit status from /home/pterjan/rpmbuild/tmp/rpm-tmp.xC7bP6 (%build) RPM build errors: Bad exit status from /home/pterjan/rpmbuild/tmp/rpm-tmp.xC7bP6 (%build) I: [iurt_root_command] ERROR: chroot