compilation fails - namedEnum.cpp
marekbedy opened this issue · 3 comments
Hi Ondro,
compilation stops here on the current code from mater:
[ 20%] Built target simpleServer
[ 20%] Building CXX object src/imtjson/src/imtjson/CMakeFiles/imtjson.dir/namedEnum.cpp.o
In file included from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:84:22: error: field ‘whatMsg’ has incomplete type ‘std::string’ {aka ‘std::__cxx11::basic_string’}
84 | mutable std::string whatMsg;
| ^~~~~~~
In file included from /usr/include/c++/10/iosfwd:39,
from /usr/include/c++/10/string_view:40,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:3,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/usr/include/c++/10/bits/stringfwd.h:74:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string’}
74 | class basic_string;
| ^~~~~~~~~~~~
In file included from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:86:14: error: field ‘errorEnum’ has incomplete type ‘std::string’ {aka ‘std::__cxx11::basic_string’}
86 | std::string errorEnum;
| ^~~~~~~~~
In file included from /usr/include/c++/10/iosfwd:39,
from /usr/include/c++/10/string_view:40,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:3,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/usr/include/c++/10/bits/stringfwd.h:74:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string’}
74 | class basic_string;
| ^~~~~~~~~~~~
In file included from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:135:84: error: return type ‘std::string’ {aka ‘class std::__cxx11::basic_string’} is incomplete
135 | inline std::string json::NamedEnum::allEnums(std::string_view separator) const {
| ^~~~~
/home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h: In member function ‘void json::NamedEnum::allEnums(std::string_view) const’:
/home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:139:14: error: ‘res’ has incomplete type
139 | std::string res;
| ^~~
In file included from /usr/include/c++/10/iosfwd:39,
from /usr/include/c++/10/string_view:40,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:3,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/usr/include/c++/10/bits/stringfwd.h:74:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string’}
74 | class basic_string;
| ^~~~~~~~~~~~
In file included from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:139:14: error: ‘res’ has incomplete type
139 | std::string res;
| ^~~
In file included from /usr/include/c++/10/iosfwd:39,
from /usr/include/c++/10/string_view:40,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:3,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/usr/include/c++/10/bits/stringfwd.h:74:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string’}
74 | class basic_string;
| ^~~~~~~~~~~~
In file included from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:139:14: error: ‘res’ has incomplete type
139 | std::string res;
| ^~~
In file included from /usr/include/c++/10/iosfwd:39,
from /usr/include/c++/10/string_view:40,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.h:3,
from /home/mmbot/mmbot_github_master/mmbot/src/imtjson/src/imtjson/namedEnum.cpp:8:
/usr/include/c++/10/bits/stringfwd.h:74:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string’}
74 | class basic_string;
| ^~~~~~~~~~~~
make[2]: *** [src/imtjson/src/imtjson/CMakeFiles/imtjson.dir/build.make:186: src/imtjson/src/imtjson/CMakeFiles/imtjson.dir/namedEnum.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:506: src/imtjson/src/imtjson/CMakeFiles/imtjson.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
Should be fixed in latest commit
Succesfully compiled in gcc-7,gcc-8,gcc-9,gcc-10,clang-8,clang-9,clang-10,clang-11 and clang-12
Ensure that you have updated submodules
(script ./update should handle this)
I can confirm, compilation works again, thx