std::to_string()

Discussion to talk about software related topics only.
Post Reply
jandarm
Posts: 7
Joined: Sat Dec 07, 2019 2:35 pm

std::to_string()

Post by jandarm » Sat Dec 07, 2019 3:47 pm

In gcc 5.2.0 compiler, by default, when trying to use std::to_string(), you get an error

Code: Select all

error: 'to_string' is not a member of 'std'
I found that if the following defines are enabled (added to Preprocessor) in gcc-5.2.0 (nndk 2.8.x)

Code: Select all

_GLIBCXX_USE_C99
_GLIBCXX_USE_C99_DYNAMIC
For gcc 8.1.0 (nndk 3.0.0):

Code: Select all

_GLIBCXX_USE_C99_STDIO
then the code compiles successfully. See attached screenshot (example from cppreference).

I don’t know why so far no one on the forum has asked about std::to_string(), because this function is convenient and needed in every project...

Maybe because it can throw an exception, and NetBurner consumers in most cases write code only for safety-critical projects in C-style without using any exceptions?
Attachments
screen.png
screen.png (88.95 KiB) Viewed 2374 times

Post Reply