PlatformIO Community

.pio\libdeps\esp32cam\Adafruit Unified Sensor/Adafruit_Sensor.h:155:3: error: conflicting declaration 'typedef struct sensor_t sensor_t'

image

Do not simulatenously include esp_camera.h and the Adafruit_Sensor.h library in the same .h or .cpp file, they have clashing typename definitions.

You can use them in two different .cpp files though. So just put camera functionality in one .cpp file and expose them via a header (which does not do a #include <esp_camera.h>) and the sensor code in a different .cpp file (which then technically can have a .h file that does a #include "Adafruit_Sensor.h" if the other header is not included too).

See https://github.com/adafruit/Adafruit_Sensor/issues/37.