Conflicitng declaration in Adafruit_Sensor & esp32-camera

In file included from /home/hodur/Workspace/CombinedCamHttpSensor/CombinedCamHttpSensor.ino:8:0:
/home/hodur/Arduino/libraries/Adafruit_Unified_Sensor/Adafruit_Sensor.h:139:3: error: conflicting declaration 'typedef struct sensor_t sensor_t'
} sensor_t;
^
In file included from /home/hodur/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/esp32-camera/esp_camera.h:70:0,
from /home/hodur/Workspace/CombinedCamHttpSensor/CombinedCamHttpSensor.ino:4:
/home/hodur/.arduino15/packages/esp32/hardware/esp32/1.0.1/tools/sdk/include/esp32-camera/sensor.h:122:3: note: previous declaration as 'typedef struct _sensor sensor_t'
} sensor_t;
^
exit status 1

*************************dependecies *****************************************

#include "FS.h"
#include "SD_MMC.h"
#include "esp_camera.h"

#include <WiFi.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_TSL2591.h>

Looking for suggestions to resolve this.

My quick and dirty way to solve was,

just rename the structure from sensor_t to Adafruit_sensor_t in all related files.
Adafruit_BME280.cpp, Adafruit_BME280.h, Adafruit_Sensor.cpp and Adafruit_Sensor.h

and include all files into your project.

Then change all includes to the two header files to locally (e.g. change
#include <Adafruit_Sensor.h>
to
#include "Adafruit_Sensor.h"
)

That's it

1 Like