dsp56300/gearmulator

Latest github commit fails to build on EndeavourOS (Arch derivative)

Closed this issue · 4 comments

Kirtai commented

Error is as follows

[ 87%] Building CXX object source/xtLib/CMakeFiles/xtLib.dir/xtState.cpp.o
[ 87%] Linking CXX executable n2xTestConsole
/home/faith/tmp/audio/gearmulator/source/xtLib/xtState.cpp: In lambda function:
/home/faith/tmp/audio/gearmulator/source/xtLib/xtState.cpp:796:68: error: no matching function for call to ‘find(std::array<xt::Id<short unsigned int, xt::IdType::WaveId>, 64>::iterator, std::array<xt::Id<short unsigned int, xt::IdType::WaveId>, 64>::iterator, const xt::Id<short unsigned int, xt::IdType::WaveId>&)’
  796 |                                                 auto it = std::find(table.begin(), table.end(), waveId);
      |                                                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14.2.1/bits/locale_facets.h:48,
                 from /usr/include/c++/14.2.1/bits/basic_ios.h:37,
                 from /usr/include/c++/14.2.1/ios:46,
                 from /usr/include/c++/14.2.1/ostream:40,
                 from /usr/include/c++/14.2.1/iostream:41,
                 from /home/faith/tmp/audio/gearmulator/source/xtLib/../synthLib/midiToSysex.h:4,
                 from /home/faith/tmp/audio/gearmulator/source/xtLib/xtState.cpp:12:
/usr/include/c++/14.2.1/bits/streambuf_iterator.h:435:5: note: candidate: ‘template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)’
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14.2.1/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
/home/faith/tmp/audio/gearmulator/source/xtLib/xtState.cpp:796:68: note:   mismatched types ‘std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >’ and ‘std::array<xt::Id<short unsigned int, xt::IdType::WaveId>, 64>::value_type*’ {aka ‘xt::Id<short unsigned int, xt::IdType::WaveId>*’}
  796 |                                                 auto it = std::find(table.begin(), table.end(), waveId);
      |                                                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [source/xtLib/CMakeFiles/xtLib.dir/build.make:233: source/xtLib/CMakeFiles/xtLib.dir/xtState.cpp.o] Error 1

What compiler/version is this? Is adding a #include <algorithm> a fix?

Kirtai commented

I have
gcc version 14.2.1 20240910 (GCC)
clang version 18.1.8

Yes, it compiles with #include <algorithm> added to gearmulator/source/xtLib/xtState.cpp

Looks like another case of compilers getting stricter.

I'm getting hit with the exact same problem on my Gentoo system with gcc version: 14.2.1 20241116

Before finding this report i tried to find the exact commit:

Last working version: 7bd8ba3
First broken build: f894097

But yes, adding #include <algorithm> does fix the issue.

thanks for confirmation, fix is pushed