I am getting a 500+ error message when trying to compile a sketch that ha always worked before. This is one part of the error message, the rest of it is very similar.
C:\Users\mwthe\AppData\Local\Temp\arduino-sketch-47D9B65AC61AD6BCD7A0C63423B73D92\libraries\AsyncTCP\AsyncTCP.cpp.o: In function AsyncClient::onTimeout(std::function<void (void*, AsyncClient*, unsigned int)>, void*)': AsyncTCP.cpp:(.text._ZN11AsyncClient9onTimeoutESt8functionIFvPvPS_jEES1_+0x0): multiple definition of AsyncClient::onTimeout(std::function<void (void*, AsyncClient*, unsigned int)>, void*)'
My sketch folder is set to e:\OneDrive\Documents\Arduino and the libraries are installed there.
This is the section of my code that deals with the libraries.
#include <Arduino.h>
#include <WiFi.h>
extern "C" {
#include "freertos/FreeRTOS.h"
#include "freertos/timers.h"
}
#include <AsyncMqttClient.h>
//#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
What does the "first defined here" part of the error message say?
John, thanks for taking the time to answer.
I have tried reverting to IDE 1.8.19 in case it was 2.03 that was causing the problem as it always used to work fine. First section of the latest error message is.
e:/onedrive/documents/arduinodata/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: libraries\WiFi\WiFi.cpp.o: in function WiFiClass::printDiag(Print&)': E:\OneDrive\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.5\libraries\WiFi\src/WiFi.cpp:49: multiple definition of WiFiClass::printDiag(Print&)'; libraries\WiFi\WiFi - Copy.cpp.o:E:\OneDrive\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.5\libraries\WiFi\src/WiFi - Copy.cpp:49: first defined here
It looks like something got screwed up in your ESP32 install. It looks like at least the WiFi/src/WiFi.cpp file got duplicated as WiFi/src/WiFi - Copy.cpp. I suspect one directory got copied over another and the copy process preserved the duplicate files by renaming the original to 'name - Copy'. The build process doesn't know not to include both in the library.
Try updating your ESP32 support to 2.0.6 using the board manager. That SHOULD delete the old libraries when installing the latest.
John,
Thanks, I have a feeling that Onedrive may have done this, I will try deleting all the - Copy files.