Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling error: no match for 'operator+=' (operand types are 'String' and 'char [(<anonymous> + 1)]') #68

Open
mnour94 opened this issue Apr 24, 2022 · 2 comments

Comments

@mnour94
Copy link

mnour94 commented Apr 24, 2022

C:\Users\m\Documents\Arduino\libraries\aws-mqtt-websockets-master\AWSWebSocketClient.cpp: In member function 'char* AWSWebSocketClient::generateAWSPath(uint16_t)':

C:\Users\m\Documents\Arduino\libraries\aws-mqtt-websockets-master\AWSWebSocketClient.cpp:210:16: error: no match for 'operator+=' (operand types are 'String' and 'char [( + 1)]')

210 | key_credential+=credentialScope;

  |  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

In file included from C:\Users\maria\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Arduino.h:286,

             from C:\Users\m\Documents\Arduino\libraries\aws-mqtt-websockets-master\AWSWebSocketClient.h:4,

             from C:\Users\m\Documents\Arduino\libraries\aws-mqtt-websockets-master\AWSWebSocketClient.cpp:1:

C:\Users\ma\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/WString.h:133:17: note: candidate: 'template String& String::operator+=(const T&)'

133 | String &operator +=(const T &rhs) {

  |                 ^~~~~~~~

C:\Users\m\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/WString.h:133:17: note: template argument deduction/substitution failed:

C:\Users\m\Documents\Arduino\libraries\aws-mqtt-websockets-master\AWSWebSocketClient.cpp:210:18: note: variable-sized array type 'char [( + 1)]' is not a valid template argument

210 | key_credential+=credentialScope;

  |                  ^~~~~~~~~~~~~~~

exit status 1

Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@kanaksony
Copy link

kanaksony commented May 20, 2022

I am also facing the same issue. @mnour94 Do you find any solution?
Arduino Version: 1.8.19 (Windows Store 1.8.57.0)

Here is the log of error:

Compiling library "aws-mqtt-websockets-1.3.0"
"C:\Users\user\Documents\ArduinoData\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.3-gcc10.3-9bcba0b/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE "-IC:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1/tools/sdk/include" "-IC:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1/tools/sdk/lwip2/include" "-IC:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\Users\user\AppData\Local\Temp\arduino_build_368431/core" -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10819 -DARDUINO_ESP8266_NODEMCU_ESP12E -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD="ESP8266_NODEMCU_ESP12E"" -DLED_BUILTIN=2 -DFLASHMODE_DIO -DESP8266 "-IC:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266" "-IC:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1\variants\nodemcu" "-IC:\Users\user\Documents\Arduino\libraries\aws-sdk-arduino-master" "-IC:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266WiFi\src" "-IC:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1\libraries\Hash\src" "-IC:\Users\user\Documents\Arduino\libraries\PubSubClient\src" "-IC:\Users\user\Documents\Arduino\libraries\aws-mqtt-websockets-1.3.0" "-IC:\Users\user\Documents\Arduino\libraries\arduinoWebSockets-2.2.0\src" "C:\Users\user\Documents\Arduino\libraries\aws-mqtt-websockets-1.3.0\AWSWebSocketClient.cpp" -o "C:\Users\user\AppData\Local\Temp\arduino_build_368431\libraries\aws-mqtt-websockets-1.3.0\AWSWebSocketClient.cpp.o"
C:\Users\user\Documents\Arduino\libraries\aws-mqtt-websockets-1.3.0\AWSWebSocketClient.cpp: In member function 'char* AWSWebSocketClient::generateAWSPath(uint16_t)':
C:\Users\user\Documents\Arduino\libraries\aws-mqtt-websockets-1.3.0\AWSWebSocketClient.cpp:209:16: error: no match for 'operator+=' (operand types are 'String' and 'char [( + 1)]')
209 | key_credential+=credentialScope;
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from C:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266/Arduino.h:286,
from C:\Users\user\Documents\Arduino\libraries\aws-mqtt-websockets-1.3.0\AWSWebSocketClient.h:4,
from C:\Users\user\Documents\Arduino\libraries\aws-mqtt-websockets-1.3.0\AWSWebSocketClient.cpp:1:
C:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266/WString.h:133:17: note: candidate: 'template String& String::operator+=(const T&)'
133 | String &operator +=(const T &rhs) {
| ^~~~~~~~
C:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1\cores\esp8266/WString.h:133:17: note: template argument deduction/substitution failed:
C:\Users\user\Documents\Arduino\libraries\aws-mqtt-websockets-1.3.0\AWSWebSocketClient.cpp:209:18: note: variable-sized array type 'char [( + 1)]' is not a valid template argument
209 | key_credential+=credentialScope;
| ^~~~~~~~~~~~~~~
Using library aws-sdk-arduino-master in folder: C:\Users\user\Documents\Arduino\libraries\aws-sdk-arduino-master (legacy)
Using library ESP8266WiFi at version 1.0 in folder: C:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266WiFi
Using library Hash at version 1.0 in folder: C:\Users\user\Documents\ArduinoData\packages\esp8266\hardware\esp8266\3.0.1\libraries\Hash
Using library PubSubClient at version 2.8 in folder: C:\Users\user\Documents\Arduino\libraries\PubSubClient
Using library aws-mqtt-websockets-1.3.0 in folder: C:\Users\user\Documents\Arduino\libraries\aws-mqtt-websockets-1.3.0 (legacy)
Using library arduinoWebSockets-2.2.0 at version 2.2.0 in folder: C:\Users\user\Documents\Arduino\libraries\arduinoWebSockets-2.2.0
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

@JohanM84
Copy link

JohanM84 commented Jun 23, 2022

Reverting https://github.com/esp8266/Arduino to 2.7.3 solved this issue for me

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

No branches or pull requests

3 participants