Skip to content

clang-19 fails to build vtk-9.4.1: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'

In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/IO/CellGrid/vtkCellGridReader.cxx:4:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/IO/CellGrid/vtkCellGridReader.h:19:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/ExecutionModel/vtkCellGridAlgorithm.h:23:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/DataModel/vtkCellGrid.h:23:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/DataModel/vtkCellGridRangeQuery.h:24:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/DataModel/vtkCellAttribute.h:21:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/Core/vtkStringToken.h:30:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/ThirdParty/nlohmannjson/vtknlohmannjson/include/vtknlohmann/json.hpp:57:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/ThirdParty/nlohmannjson/vtknlohmannjson/include/vtknlohmann/detail/input/binary_reader.hpp:17:
/usr/ports/math/vtk9/work/VTK-9.4.1/ThirdParty/nlohmannjson/vtknlohmannjson/include/vtknlohmann/detail/input/input_adapters.hpp:138:19: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  138 |     typename std::char_traits<char_type>::int_type get_character()
      |                   ^
/usr/ports/math/vtk9/work/VTK-9.4.1/ThirdParty/nlohmannjson/vtknlohmannjson/include/vtknlohmann/json.hpp:7901:19: note: in instantiation of template class 'vtknlohmann::detail::iterator_input_adapter<std::__wrap_iter<unsigned char *>>' requested here
 7901 |         auto ia = detail::input_adapter(std::move(first), std::move(last));
      |                   ^
/usr/ports/math/vtk9/work/VTK-9.4.1/IO/CellGrid/vtkCellGridReader.cxx:412:28: note: in instantiation of function template specialization 'vtknlohmann::basic_json<>::from_msgpack<std::__wrap_iter<unsigned char *>>' requested here
  412 |       jj = nlohmann::json::from_msgpack(data.begin(), data.end(), false);
      |                            ^
/usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/IO/CellGrid/vtkCellGridReader.cxx:4:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/IO/CellGrid/vtkCellGridReader.h:19:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/ExecutionModel/vtkCellGridAlgorithm.h:23:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/DataModel/vtkCellGrid.h:23:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/DataModel/vtkCellGridRangeQuery.h:24:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/DataModel/vtkCellAttribute.h:21:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/Common/Core/vtkStringToken.h:30:
In file included from /usr/ports/math/vtk9/work/VTK-9.4.1/ThirdParty/nlohmannjson/vtknlohmannjson/include/vtknlohmann/json.hpp:57:
/usr/ports/math/vtk9/work/VTK-9.4.1/ThirdParty/nlohmannjson/vtknlohmannjson/include/vtknlohmann/detail/input/binary_reader.hpp:68:41: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
   68 |     using char_int_type = typename std::char_traits<char_type>::int_type;
      |                                         ^
/usr/ports/math/vtk9/work/VTK-9.4.1/ThirdParty/nlohmannjson/vtknlohmannjson/include/vtknlohmann/json.hpp:7902:26: note: in instantiation of template class 'vtknlohmann::detail::binary_reader<vtknlohmann::basic_json<>, vtknlohmann::detail::iterator_input_adapter<std::__wrap_iter<unsigned char *>>>' requested here
 7902 |         const bool res = binary_reader<decltype(ia)>(std::move(ia)).sax_parse(input_format_t::msgpack, &sdp, strict);
      |                          ^
/usr/ports/math/vtk9/work/VTK-9.4.1/IO/CellGrid/vtkCellGridReader.cxx:412:28: note: in instantiation of function template specialization 'vtknlohmann::basic_json<>::from_msgpack<std::__wrap_iter<unsigned char *>>' requested here
  412 |       jj = nlohmann::json::from_msgpack(data.begin(), data.end(), false);
      |                            ^
/usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
2 errors generated.

FreeBSD 14.2