mobizt / ESP-Mail-Client

The comprehensive Arduino Email Client Library to send and read Email for Arduino devices. The library also supports other network shields or modules e.g., Wi-Fi, Ethernet, and GSM/4G modules.
https://mobizt.github.io/ESP-Mail-Client/
MIT License
200 stars 58 forks source link

.pio/libdeps/esp32dev/ESP Mail Client/src/extras/MB_Time.h:373:9: error: ambiguous overload for 'operator+=' (operand types are 'MB_String' and 'int') s += 0; ~~^~~~ #221

Closed DanielW0830 closed 1 year ago

DanielW0830 commented 1 year ago

Build tool used:

Board used (ESP32/ESP8266/Arudino):

Other Libraries That are used:

when I try to use the latest version of the lib I get arror in MB_String Older versions work, (I think 1.6.2, but not the newer ones)

Share code snippet to reproduce the issue:


In file included from .pio/libdeps/esp32dev/ESP Mail Client/src/ESP_Mail_Client.h:43,
                 from src/main.cpp:50:
.pio/libdeps/esp32dev/ESP Mail Client/src/extras/MB_Time.h:373:9: error: ambiguous overload for 'operator+=' (operand types are 'MB_String' and 'int')
       s += 0;
       ~~^~~~

Additional information and things you've tried:

DanielW0830 commented 1 year ago

It's prob some version of the core I'm using.... dunno....

PACKAGES:

mobizt commented 1 year ago

The library developed in VScode and PlatformIO and everything works normally in PlatformIO and Arduino IDE.

This error is not related to library unless your PlatformIO installation and update issue.

Please read this and follow when you updated your PlatformIO from older 2.0.0 to the newer version. https://github.com/mobizt/ESP-Mail-Client#library-instalation

mobizt commented 1 year ago

In summary, you need to clear the old installation of this library that may be installed globally in your PC temp directory since PlatformIO older version.

In PlatformIO newer version, the library will be installed locally to the project folder.

When the compiler (linker) searches for the header file and sees multiples files with the same name from both local storage and global storage, it may choose the wrong older one to compile and causes the compilation error.

MB_String.h is the wrong file links in this case as this old version file remains in your PlatformIO global temp folder.