Look into charconv header. For example GCC have next guard in it
#if defined __cpp_lib_to_chars || _GLIBCXX_HAVE_USELOCALE
So it can be not implemented, or your compiler not configured to use at least C++ 17 standard. I.e. no -std=c++20
for GCC and Clang or /std:c++latest
for Microsoft VC++ command line options passed to your compiler, or your implementation i.e. port not implementing this functionality and not fully implement a standard.
You always can replace from_chars with strtof c function.
For example:
#include <iostream>
#include <string_view>
#include <system_error>
#include <cmath>
#include <charconv>
#include <cstdlib>
int main(int argc, const char** argv)
{
std::string_view sv("12.345678");
#ifdef __cpp_lib_to_chars
float result = NAN;
auto conv_ret = std::from_chars(sv.data(), (sv.data() + sv.size()), result);
std::error_code ec = std::make_error_code(conv_ret.ec);
#else
char *endp = nullptr;
float result = std::strtof(sv.data(), &endp);
std::error_code ec;
if (errno == ERANGE) {
ec = std::make_error_code(std::errc::result_out_of_range);
}
#endif
if(ec) {
std::cerr << ec.message() << std::endl;
return ec.value();
}
std::cout << "Float: " << result << std::endl;
return 0;
}