I am trying to use std::to_string()
, but get error: 'to_string' is not a member of 'std'
. From this answer, it seems to be a problem with not supporting C++11. However, using “verbose build” as advised in this answer, I see -std=gnu++11
which I believe means that I am using C++11. It looks like I can use std::ostringstream
instead, but I’d really like to understand why it is that I am unable to use std::to_string
and whether I can change that. Here is the full output of my verbose build:
Processing nodemcu-32s (platform: espressif32; board: nodemcu-32s; framework: arduino; lib_deps: teemuatlut/TMCStepper@^0.7.3;
monitor_speed: 115200)
-------------------------------------------------------------------------------------------------------------------------------CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/nodemcu-32s.html
PLATFORM: Espressif 32 (3.4.0) > NodeMCU-32S
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 3.10006.210326 (1.0.6)
- tool-esptoolpy 1.30100.210531 (3.1.0)
- toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <TMCStepper> 0.7.3 (C:\Users\jarat\Documents\PlatformIO\Projects\eqPlatformMain\.pio\libdeps\nodemcu-32s\TMCStepper)
| |-- <SPI> 1.0 (C:\Users\jarat\.platformio\packages\framework-arduinoespressif32\libraries\SPI)
|-- <ESP32 BLE Arduino> 1.0.1 (C:\Users\jarat\.platformio\packages\framework-arduinoespressif32\libraries\BLE)
|-- <Preferences> 1.0 (C:\Users\jarat\.platformio\packages\framework-arduinoespressif32\libraries\Preferences)
Building in release mode
xtensa-esp32-elf-g++ -o .pio\build\nodemcu-32s\src\main.cpp.o -c -fno-rtti -fno-exceptions -std=gnu++11 -Os -g3 -Wall -nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-sections -fdata-sections
-fstrict-volatile-bitfields -Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-unused-parameter -Wno-sign-compare -fstack-protector -fexceptions -Werror=reorder -DPLATFORMIO=50203 -DARDUINO_NodeMCU_32S -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DARDUINO=10805 -DARDUINO_ARCH_ESP32 -DARDUINO_VARIANT=\"nodemcu-32s\" -DARDUINO_BOARD=\"NodeMCU-32S\" -Iinclude -Isrc -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\libraries\Preferences\src -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\libraries\BLE\src -I.pio\libdeps\nodemcu-32s\TMCStepper\src -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\libraries\SPI\src -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\config -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_trace -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\app_update -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\asio -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bootloader_support -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\bt -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\coap -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\console -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\driver -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\efuse -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp-tls -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp32 -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_adc_cal -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_event -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_http_client -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_http_server -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_https_ota -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_https_server -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_ringbuf -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp_websocket_client -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\espcoredump -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ethernet -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\expat -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\fatfs -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\freemodbus -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\freertos -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\heap -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\idf_test -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\jsmn -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\json -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\libsodium -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\log -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\lwip -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mbedtls -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mdns -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\micro-ecc -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\mqtt -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nghttp -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\nvs_flash -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\openssl -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\protobuf-c -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\protocomm -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\pthread -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\sdmmc -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\smartconfig_ack -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\soc -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spi_flash -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\spiffs -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\tcp_transport -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\tcpip_adapter -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\ulp -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\unity -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\vfs -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wear_levelling -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wifi_provisioning -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\wpa_supplicant -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\xtensa-debug-module -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp-face -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\esp32-camera -IC:\Users\jarat\.platformio\packages\framework-src\main.cpp: In member function 'virtual void setup()::trackingCallback::onRead(BLECharacteristic*)':
arduinoespressif32\tools\sdk\include\esp-face -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\fb_gfx -IC:\Users\jarat\.platformio\packasrc\main.cpp:270:33: error: 'to_string' is not a member of 'std'
ges\framework-arduinoesp std::string trackingStr = std::to_string(tracking);
res ^
sif32\cores\esp32 -IC:\Users\jarat\.platformio\packages\framework-arduinoespressif32\variants\nodemcu-32s src\main.cpp
*** [.pio\build\nodemcu-32s\src\main.cpp.o] Error 1