I have a project that has evolved over time that I now build for ESP8266 and ESP32.
I use #ifdef compiler directive to include the libraries where there are differences between the two processors.
In a fresh project this works as expected.
In my evolved project it doesn't, which causes compilation to fail.
Removing the unwanted library from the libraries folder enables the project to be built successfully.
It's a bit annoying to have to do this every time I change processor.
I've tried updating the library.properties architectures value but that doesn't work.
The 'incorrect' library is definitely not included anywhere in the project but for some reason is being included.
The libraries concerned are:
for ESP8266, ESPAsyncTCP, for ESP32 AsyncTCP
I have also noticed that when I build the ESP32 code, which I'm planning to add bluetooth to, the Bluetooth and BLE libraries are being included and compiled, even though the code is excluded.
#ifdef ESP32
#warning Building ESP32
#include <ESPmDNS.h>
#include <ArduinoOTA.h>
#include <Update.h>
#include <AsyncTCP.h>
#include <FS.h>
#include <ESP32SSDP.h>
static const uint8_t I2C_SDA = 18;
static const uint8_t I2C_SCL = 19;
//#define USE_BLUETOOTH
//#define USE_BLE
#ifdef USE_BLE
#include "BLEDevice.h"
#include <BLEUtils.h>
#include <BLEServer.h>
#include <BLE2902.h>
#endif
#ifdef USE_BLUETOOTH
#include "BluetoothSerial.h"
extern BluetoothSerial SerialBT;
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
#endif
#else
#warning Building ESP8266
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#include <Hash.h>
#endif
Library Include Paths (26)
Include Path aries\BluetoothSerial\src'
Include Path aries\BLE\src'
.
.