-->
Page 1 of 1

esp8266-sendemail will not compile with board 2.5.0

PostPosted: Sun Apr 14, 2019 12:53 pm
by esp360t
The attached sketch works with esp8266 board Version 2.4.2

It will NOT compile using board Version 2.5.0

The compiler error points to line 45 in sendemail.cpp library file.

ambiguous overload for 'operator+=' (operand types are 'String' and 'IPAddress')
buffer += client->localIP();

Can someone suggest an edit to sendemail.cpp so that it will work with board Version 2.5.0 ?

Unfortunately the author of the sendemail library, Peter Gorasz, does not include his email on GitHub.

Here is the error text:

Arduino: 1.8.8 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Enabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

C:\Utilities\arduino-1.8.8\portable\sketchbook\libraries\esp8266-sendemail-master\sendemail.cpp: In member function 'bool SendEmail::send(const String&, const String&, const String&, const String&)':

C:\Utilities\arduino-1.8.8\portable\sketchbook\libraries\esp8266-sendemail-master\sendemail.cpp:45:10: error: ambiguous overload for 'operator+=' (operand types are 'String' and 'IPAddress')

buffer += client->localIP();

^

C:\Utilities\arduino-1.8.8\portable\sketchbook\libraries\esp8266-sendemail-master\sendemail.cpp:45:10: note: candidates are:

In file included from C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/Arduino.h:261:0,

from C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src/WiFiClient.h:25,

from C:\Utilities\arduino-1.8.8\portable\sketchbook\libraries\esp8266-sendemail-master\sendemail.h:6,

from C:\Utilities\arduino-1.8.8\portable\sketchbook\libraries\esp8266-sendemail-master\sendemail.cpp:1:

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:120:18: note: String& String::operator+=(const char*) <near match>

String & operator +=(const char *cstr) {

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:120:18: note: no known conversion for argument 1 from 'IPAddress' to 'const char*'

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:124:18: note: String& String::operator+=(char)

String & operator +=(char c) {

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:128:18: note: String& String::operator+=(unsigned char)

String & operator +=(unsigned char num) {

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:132:18: note: String& String::operator+=(int)

String & operator +=(int num) {

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:136:18: note: String& String::operator+=(unsigned int)

String & operator +=(unsigned int num) {

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:140:18: note: String& String::operator+=(long int)

String & operator +=(long num) {

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:144:18: note: String& String::operator+=(long unsigned int)

String & operator +=(unsigned long num) {

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:148:18: note: String& String::operator+=(float)

String & operator +=(float num) {

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:152:18: note: String& String::operator+=(double)

String & operator +=(double num) {

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:156:18: note: String& String::operator+=(const __FlashStringHelper*) <near match>

String & operator += (const __FlashStringHelper *str){

^

C:\Utilities\arduino-1.8.8\portable\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266/WString.h:156:18: note: no known conversion for argument 1 from 'IPAddress' to 'const __FlashStringHelper*'

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.

Re: esp8266-sendemail will not compile with board 2.5.0

PostPosted: Mon Apr 15, 2019 2:46 am
by schufti
then stay with 2.4.2 it is more stable after all.
There was good reason they switched back from pre3.0.0 to old sdk for current git...
and in current git they introduced upload with python, again breaking lots of working setups