Compilation error: ESP32 cam giving this error: 'CAMERA_FB_IN_PSRAM' was not declared in this scope

Hi. So i am trying to run an object detection model on the esp32 cam and i have downloaded the arduino library from the edge impulse studio. After compiling it, i am getting this error:

/private/var/folders/9p/hp8d4cf11951m6wjg5pn4mpr0000gn/T/.arduinoIDE-unsaved2023229-89059-n6viv0.fhv09/esp32_camera/esp32_camera.ino:116:20: error: ‘CAMERA_FB_IN_PSRAM’ was not declared in this scope
.fb_location = CAMERA_FB_IN_PSRAM,
^
/private/var/folders/9p/hp8d4cf11951m6wjg5pn4mpr0000gn/T/.arduinoIDE-unsaved2023229-89059-n6viv0.fhv09/esp32_camera/esp32_camera.ino:117:18: error: ‘CAMERA_GRAB_WHEN_EMPTY’ was not declared in this scope
.grab_mode = CAMERA_GRAB_WHEN_EMPTY,
^
/private/var/folders/9p/hp8d4cf11951m6wjg5pn4mpr0000gn/T/.arduinoIDE-unsaved2023229-89059-n6viv0.fhv09/esp32_camera/esp32_camera.ino:118:1: error: ‘camera_config_t’ has no non-static data member named ‘fb_location’
};
^

exit status 1

Compilation error: ‘CAMERA_FB_IN_PSRAM’ was not declared in this scope

UPDATE: Ok so i updated the esp32 library and its compiling now but a new error has come up:
(serial monitor)
ERR: Camera is not initialized
Failed to capture image

Hi @zappy383

The cable for the camera may need to be removed and reconnected. (From the last error you shared)

Which model of the esp32 cam are you using and what guide are you following? Thanks!

Eoin

Hi Jorduino! Thanks for the response but I have solved the error. I just had to press the reset button on the esp32 cam again. Once I did it, The detections began.

Hi @zappy383 I have the same problem that you have from the beginning, what did you do to make it compile? And in the event that the esp library updates it, what version did you put it on?