Error: 'to_string' is not a member of 'std'

I’m using PIO 3.5.3b5 with the teensy36/Arduino target. When I attempt to reference std::to_string, I get the following error:

error: ‘to_string’ is not a member of ‘std’

I get the same error for a variety of other string-manipulation functions (e.g., sprintf, strtoll). I see the same issue mentioned here but I am not sure if it is caused by the same problem. I’ve done some investigation but can’t figure out how to properly resolve the error. I can see that the compiler is being directed to use the gnu++14 standard which should include these functions, but they are apparently missing.

Any suggestions?

I ran into this issue before. The Teensy pkg does not support the std library well with regards to to_string and other std functionality. I ended up using the Arduino String class to do the conversions that I needed.

If you run into sprintf with floats, you may need to add this line to your code.

asm(".global _printf_float");