You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Debian 12, pulling the latest main branch (3941a355), cmake, then make, I get the following error:
src/include/cursor.h:137:21: error: field ‘Ident’ has incomplete type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}
137 | std::string Ident; /// Identifier to reference it
| ^~~~~
To recreate this on an unpatched Debian 12 using gcc 12.2.0 toolchain:
$ git clone --recurse-submodules https://github.com/Wargus/strratagum
$ cd stratagum
$ mkdir build
$ cmake ..
$ VERBOSE=defined make
<snipped out the largely successful error-free, warning-free compilation ...>
make[2]: Entering directory '/home/user/admin/games/stratagus/build'
cd /home/user/admin/games/stratagus/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/admin/games/stratagus /home/user/admin/games/stratagus /home/user/admin/games/stratagus/build /home/user/admin/games/stratagus/build /home/user/admin/games/stratagus/build/CMakeFiles/stratagus_lib.dir/DependInfo.cmake --color=
Dependencies file "CMakeFiles/stratagus_lib.dir/src/ui/mouse.cpp.o.d" is newer than depends file "/home/user/admin/games/stratagus/build/CMakeFiles/stratagus_lib.dir/compiler_depend.internal".
Consolidate compiler generated dependencies of target stratagus_lib
make[2]: Leaving directory '/home/user/admin/games/stratagus/build'
make -f CMakeFiles/stratagus_lib.dir/build.make CMakeFiles/stratagus_lib.dir/build
make[2]: Entering directory '/home/user/admin/games/stratagus/build'
[ 19%] Building CXX object CMakeFiles/stratagus_lib.dir/src/ui/mouse.cpp.o
/usr/bin/c++ -DDYNAMIC_LOAD -DHAVE_GETOPT -DHAVE_STRNLEN -DPIXMAPS=\"/usr/local/share/pixmaps\" -DUSE_BZ2LIB -DUSE_LINUX -DUSE_OPENMP -DUSE_VORBIS -DUSE_ZLIB -I/home/user/admin/games/stratagus/src/include -I/home/user/admin/games/stratagus/src/third_party -I/home/user/admin/games/stratagus/build -I/home/user/admin/games/stratagus/third-party/mdns -I/home/user/admin/games/stratagus/third-party/spiritless_po/include -isystem /usr/include/lua5.1 -isystem /usr/include/SDL2 -isystem /home/user/admin/games/stratagus/third-party/guichan/include -g -ggdb -fsigned-char -fPIC -fopenmp -std=gnu++17 -MD -MT CMakeFiles/stratagus_lib.dir/src/ui/mouse.cpp.o -MF CMakeFiles/stratagus_lib.dir/src/ui/mouse.cpp.o.d -o CMakeFiles/stratagus_lib.dir/src/ui/mouse.cpp.o -c /home/user/admin/games/stratagus/src/ui/mouse.cpp
In file included from /home/user/admin/games/stratagus/src/ui/mouse.cpp:43:
/home/user/admin/games/stratagus/src/include/cursor.h:137:21: error: field ‘Ident’ has incomplete type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}
137 | std::string Ident; /// Identifier to reference it
| ^~~~~
In file included from /usr/include/c++/12/iosfwd:39,
from /usr/include/c++/12/bits/shared_ptr.h:52,
from /usr/include/c++/12/memory:77,
from /home/user/admin/games/stratagus/src/include/actions.h:38,
from /home/user/admin/games/stratagus/src/include/action/action_build.h:33,
from /home/user/admin/games/stratagus/src/ui/mouse.cpp:39:
/usr/include/c++/12/bits/stringfwd.h:72:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string<char>’}
72 | class basic_string;
| ^~~~~~~~~~~~
Me think that gcc 12.2 finally kicked out the C11 and (some C17) compliance part in 100% full-force
The text was updated successfully, but these errors were encountered:
A simple adding the string.h include file into cursor.h appears to fix the compilation problem of this source file mouse.cpp
New code snippet of cursor.h:
/*------------------------------------------------------------------------------ Includes----------------------------------------------------------------------------*/#include<string>// new line#include"sdl2_helper.h"#include"vec2i.h"#include<SDL.h>#include<vector>
egberts
pushed a commit
to egberts/stratagus
that referenced
this issue
Jun 1, 2024
On Debian 12, pulling the latest main branch (3941a355), cmake, then make, I get the following error:
To recreate this on an unpatched Debian 12 using gcc 12.2.0 toolchain:
<snipped out the largely successful error-free, warning-free compilation ...>
Me think that gcc 12.2 finally kicked out the C11 and (some C17) compliance part in 100% full-force
The text was updated successfully, but these errors were encountered: