Milkv-duo lvgl can't use std::

When I want to use std::stoi to convert a string to an integer, I find that my lvgl code cannot be compiled, and the error is as follows, can anyone help me:

lvgl/examples/widgets/chart/lv_update.c:139:5: error: 'std' undeclared (first use in this function); did you mean 'stdin'? 139 | std::string line; | ^~~ | stdin lvgl/examples/widgets/chart/lv_update.c:139:5: note: each undeclared identifier is reported only once for each function it appears in lvgl/examples/widgets/chart/lv_update.c:139:8: error: expected ';' before '::' token 139 | std::string line; | ^~ | ; lvgl/examples/widgets/chart/lv_update.c:140:16: error: expected ';' before '::' token 140 | value = std::stoi(buf); | ^~ | ;

Dear friend,

I bet this is because it’s C, not C++, what do you think?

o,soga,i know it ,i suould only use atoi。thank!

1 Like