odelot / aws-mqtt-websockets

Implementation of a middleware to use AWS MQTT service through websockets, aiming the ESP8266 plataform
GNU Lesser General Public License v3.0
231 stars 67 forks source link

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

Open mnour94 opened 2 years ago

mnour94 commented 2 years ago

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 commented 2 years ago

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++" -Dets -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 commented 2 years ago

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