Using std::to_string (C++11)
Hello,
I'm using C++11 in my current STM32F4 based project, and I'm making use of the GNU Tools for ARM Embedded Processors on Windows 7 64-bit (Thank you so much for this toolchain).
I'm trying to use the std::to_string function (new in C++11), but I get the following compilation error:
error: 'to_string' was not declared in this scope
I'm compiling with these flags:
arm-none-eabi-g++ -ffreestanding -mthumb -mcpu=cortex-m4 -mtune=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mlittle-endian -ffunction-sections -fsingle-
If, however, I compile with the following, it works fine:
arm-none-eabi-g++ -D _GLIBCXX_USE_C99=1 -D _GLIBCXX_
I figured this out by navigating header files, but it feels like a hack. Is there some reason why to_string cannot be used without these extra defines?
Thanks,
Mike
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Mike F. for more information if necessary.