I am coding a project on an ESP32 WROOM that connects to Arduino Cloud and uses the ESP Mail Client library to send email notifications.
When I try to compile the code I get a bunch of error messages about redefining objects. It looks like the two libraries are including or implementing the same code at some point and this is causing issues but I cant figure it out myself.
This project is an Xmas gift to someone(yes I know, last minute) so I would appreciate a quick solution even if it is a little janky.
Arduino Cloud 1.13.0
ESP Mail Client (by Mobizt) 3.4.15
Code to reproduce error:
#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>
#include <ESP_Mail_Client.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Error:
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(dec32be.c.o): in function `br_range_dec32be':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/dec32be.c:33: multiple definition of `br_range_dec32be'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(dec32be.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/dec32be.c:35: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(enc32be.c.o): in function `br_range_enc32be':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/enc32be.c:33: multiple definition of `br_range_enc32be'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(enc32be.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/enc32be.c:35: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o): in function `br_sha224_set_state':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:289: multiple definition of `br_sha224_set_state'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:291: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:311: multiple definition of `br_sha224_vtable'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:313: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:41: multiple definition of `br_sha224_IV'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:43: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o): in function `br_sha224_init':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:258: multiple definition of `br_sha224_init'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:260: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:329: multiple definition of `br_sha256_vtable'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:331: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:47: multiple definition of `br_sha256_IV'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:49: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o): in function `br_sha256_init':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:297: multiple definition of `br_sha256_init'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:299: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o): in function `br_sha224_state':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:281: multiple definition of `br_sha224_state'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:283: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o): in function `br_sha2small_round':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:74: multiple definition of `br_sha2small_round'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:76: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o): in function `br_sha224_update':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:267: multiple definition of `br_sha224_update'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:269: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o): in function `br_sha224_out':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:274: multiple definition of `br_sha224_out'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:276: first defined here
c:/users/dakota/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ESP_Mail_Client\SSLClient\bssl\objs.a(sha2small.c.o): in function `br_sha256_out':
c:\Users\Dakota\Documents\Arduino\libraries\ESP_Mail_Client\src\SSLClient\bssl/sha2small.c:306: multiple definition of `br_sha256_out'; C:\Users\Dakota\AppData\Local\Temp\arduino\sketches\F98D36AEE99FA0B786C99A5BED071753\libraries\ArduinoIoTCloud\tls\bearssl\objs.a(sha2small.c.o):c:\Users\Dakota\Documents\Arduino\libraries\ArduinoIoTCloud\src\tls\bearssl/sha2small.c:308: first defined here
collect2.exe: error: ld returned 1 exit status
Hi @yartsyhanenko. There has been some work to make the "ArduinoIoTCloud" library compatible with the "ESP Mail Client" library:
Unfortunately that work has not yet been completed so for now the incompatibility remains.
It is possible there might be some workaround that would allow this incompatibility to be resolved immediately, but I'm not very familiar with this subject matter so I wouldn't be able to advise you on that. Maybe one of the other forum helpers would have an idea, or maybe @robo_cant_communicate found one and would share it.