thezbyg / gpick

Advanced color picker written in C++ using GTK+ toolkit
BSD 3-Clause "New" or "Revised" License
376 stars 33 forks source link

Missing <array> in MatchPattern.h #203

Closed johnbeard closed 2 years ago

johnbeard commented 2 years ago

CharsOp (at least) uses std::array, but the header doesn't include <array>. This leads to:

In file included from /home/me/src/gpick/source/InternalConverters.cpp:23:
/home/me/src/gpick/source/common/MatchPattern.h: In instantiation of ‘struct common::detail::CharsOp<char, 2>’:
/home/me/src/gpick/source/common/MatchPattern.h:397:17:   required from ‘auto common::ops::single(const CharT (&)[Count]) [with CharT = char; long unsigned int Count = 2]’
/home/me/src/gpick/source/common/MatchPattern.h:461:45:   required from here
/home/me/src/gpick/source/common/MatchPattern.h:67:34: error: ‘common::detail::CharsOp<CharT, Count>::m_values’ has incomplete type
   67 |         std::array<CharT, Count> m_values;
      |                                  ^~~~~~~~
In file included from /home/me/src/gpick/source/common/Scoped.h:22,
                 from /home/me/src/gpick/source/Converter.h:22,
                 from /home/me/src/gpick/source/InternalConverters.h:21,
                 from /home/me/src/gpick/source/InternalConverters.cpp:19:
/usr/include/c++/12.1.0/tuple:1595:45: note: declaration of ‘struct std::array<char, 2>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
make[2]: *** [CMakeFiles/tests.dir/build.make:188: CMakeFiles/tests.dir/source/InternalConverters.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:374: CMakeFiles/tests.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /home/me/src/gpick/source/InternalConverters.cpp:23:
/home/me/src/gpick/source/common/MatchPattern.h: In instantiation of ‘struct common::detail::CharsOp<char, 2>’:
/home/me/src/gpick/source/common/MatchPattern.h:397:17:   required from ‘auto common::ops::single(const CharT (&)[Count]) [with CharT = char; long unsigned int Count = 2]’
/home/me/src/gpick/source/common/MatchPattern.h:461:45:   required from here
/home/me/src/gpick/source/common/MatchPattern.h:67:34: error: ‘common::detail::CharsOp<CharT, Count>::m_values’ has incomplete type
   67 |         std::array<CharT, Count> m_values;
      |                                  ^~~~~~~~
In file included from /home/me/src/gpick/source/common/Scoped.h:22,
                 from /home/me/src/gpick/source/Converter.h:22,
                 from /home/me/src/gpick/source/InternalConverters.h:21,
                 from /home/me/src/gpick/source/InternalConverters.cpp:19:
/usr/include/c++/12.1.0/tuple:1595:45: note: declaration of ‘struct std::array<char, 2>’
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
make[2]: *** [CMakeFiles/gpick.dir/build.make:398: CMakeFiles/gpick.dir/source/InternalConverters.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:343: CMakeFiles/gpick.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

The fix appears to just be adding the include, though I can't verify right now as it won't link against my Lua libs.

thezbyg commented 2 years ago

Fixed in 78824c6cd9818043a29617e6e75cc9e847515577. Thanks for reporting.