Skip to content

syntax errors related to String() when compiling with Arduino IDE 2.3.3#324

Open
chstear wants to merge 1 commit intoT-vK:masterfrom
chstear:syntax-errors-string-arduino-ide
Open

syntax errors related to String() when compiling with Arduino IDE 2.3.3#324
chstear wants to merge 1 commit intoT-vK:masterfrom
chstear:syntax-errors-string-arduino-ide

Conversation

@chstear
Copy link

@chstear chstear commented Oct 6, 2024

Errors when compiling in Arduino IDE 2.3.3 like the following:

/Users/chuck/Documents/Arduino/libraries/ESP32_BLE_Keyboard/BleKeyboard.cpp:106:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'String'
  106 |   BLEDevice::init(deviceName);
      |                   ^~~~~~~~~~
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}

and

/Users/chuck/Documents/Arduino/libraries/ESP32_BLE_Keyboard/BleKeyboard.cpp: In constructor 'BleKeyboard::BleKeyboard(String, String, uint8_t)':
/Users/chuck/Documents/Arduino/libraries/ESP32_BLE_Keyboard/BleKeyboard.cpp:101:37: error: 'class String' has no member named 'substr'
  101 |     , deviceName(String(deviceName).substr(0, 15))
      |                                     ^~~~~~

Reference to #322.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants