The function to_string() seems exclusive to MBED. Users will get this error.
Arduino: 1.8.12 (Windows 10), Board: "Arduino Uno"
C:\Users\user_bob\Documents\Arduino\libraries\SparkFun_I2C_GPS_Reading_and_Control\src\SparkFun_I2C_GPS_Arduino_Library.cpp: In member function 'String I2CGPS::createMTKpacket(uint16_t, String)':
C:\Users\user_bob\Documents\Arduino\libraries\SparkFun_I2C_GPS_Reading_and_Control\src\SparkFun_I2C_GPS_Arduino_Library.cpp:254:21: error: 'to_string' was not declared in this scope
configSentence += to_string(packetType);
^~~~~~~~~
C:\Users\user_bob\Documents\Arduino\libraries\SparkFun_I2C_GPS_Reading_and_Control\src\SparkFun_I2C_GPS_Arduino_Library.cpp:254:21: note: suggested alternative: 'String'
configSentence += to_string(packetType);
^~~~~~~~~
String
C:\Users\user_bob\Documents\Arduino\libraries\SparkFun_I2C_GPS_Reading_and_Control\src\SparkFun_I2C_GPS_Arduino_Library.cpp: In member function 'String I2CGPS::createPGCMDpacket(uint16_t, String)':
C:\Users\user_bob\Documents\Arduino\libraries\SparkFun_I2C_GPS_Reading_and_Control\src\SparkFun_I2C_GPS_Arduino_Library.cpp:338:21: error: 'to_string' was not declared in this scope
configSentence += to_string(packetType);
^~~~~~~~~
C:\Users\user_bob\Documents\Arduino\libraries\SparkFun_I2C_GPS_Reading_and_Control\src\SparkFun_I2C_GPS_Arduino_Library.cpp:338:21: note: suggested alternative: 'String'
configSentence += to_string(packetType);
^~~~~~~~~
String
Adding a preprocessor define to wrap it with the String() function when using it with Arduino so that it can compile.
The function
to_string()
seems exclusive toMBED
. Users will get this error.Adding a preprocessor define to wrap it with the
String()
function when using it withArduino
so that it can compile.