Hi,
std::to_string(...) is supposed be included in C++11 via <string.h>, but it seems to not be included when compiling with the Xtensa port of GCC. Am I missing something, or is it actually not available? If not, can it be made available?
to_string
Re: to_string
This incompatibility between libstdc++ and newlib seems to be discussed here: https://gcc.gnu.org/ml/libstdc++/2013-10/msg00245.html
It seems that rebuilding libstdc++ is required, and `__STDC_VERSION__` has to be tweaked while libstdc++ is going through ./configure step, so that newlib provides vprintf declaration.
It seems that rebuilding libstdc++ is required, and `__STDC_VERSION__` has to be tweaked while libstdc++ is going through ./configure step, so that newlib provides vprintf declaration.
Re: to_string
As a possible alternative, one might be able to use std::stringstream.
Once can then perform logic similar to:
std::string stream ss << "Hello world" << myDouble << " " << myInt;
std::string s = ss.str();
Once can then perform logic similar to:
std::string stream ss << "Hello world" << myDouble << " " << myInt;
std::string s = ss.str();
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: to_string
Yes, stringstream is an alternative, though it is rather heavy just to convert a single integer into an alphanumeric.
Who is online
Users browsing this forum: No registered users and 120 guests