Error when i tried to compile a arduino code for object detection

Question/Issue:
I need some help. I’m trying to make a project to detect object using a esp32-cam and arduino ide. I’ve used edge impulse to make the object detection possible. Then when i got the example code, I tried to commpile it and got an error. What did I do wrong?

the error:
exit status 1
‘CAMERA_FB_IN_PSRAM’ was not declared in this scope

Project ID:

Context/Use case:

Hi @Oddie711,

Please post the exact error you are seeing, any relevant code snippets (or a link to the code you are using), and your project ID so that we can best help troubleshoot your error.

Project ID : 397430

Full Error :
Arduino: 1.8.19 (Windows 10), Board: “AI Thinker ESP32-CAM”

In file included from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/common.h:29:0,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/integer_ops/pooling.h:21,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/micro/kernels/pooling.h:23,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/micro/micro_mutable_op_resolver.h:33,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/micro/all_ops_resolver.h:19,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/classifier/inferencing_engines/tflite_helper.h:35,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/classifier/inferencing_engines/tflite_eon.h:28,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/classifier/ei_run_classifier.h:44,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/Object_Detection_TA_inferencing.h:49,

             from C:\Users\Asus\AppData\Local\Temp\arduino_modified_sketch_31264\esp32_camera.ino:27:

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h: In function ‘T tflite::TfLiteRound(T)’:

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:26:35: error: ‘round’ is not a member of ‘std’

#define TF_LITE_GLOBAL_STD_PREFIX std

                               ^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:32:12: note: in expansion of macro ‘TF_LITE_GLOBAL_STD_PREFIX’

 return TF_LITE_GLOBAL_STD_PREFIX::std_name(x);    \

        ^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:35:1: note: in expansion of macro ‘DECLARE_STD_GLOBAL_SWITCH1’

DECLARE_STD_GLOBAL_SWITCH1(TfLiteRound, round);

^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:26:35: note: suggested alternative:

#define TF_LITE_GLOBAL_STD_PREFIX std

                               ^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:32:12: note: in expansion of macro ‘TF_LITE_GLOBAL_STD_PREFIX’

 return TF_LITE_GLOBAL_STD_PREFIX::std_name(x);    \

        ^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:35:1: note: in expansion of macro ‘DECLARE_STD_GLOBAL_SWITCH1’

DECLARE_STD_GLOBAL_SWITCH1(TfLiteRound, round);

^

In file included from C:\Users\Asus\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32/esp32-hal.h:34:0,

             from C:\Users\Asus\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32/Arduino.h:35,

             from sketch\esp32_camera.ino.cpp:1:

C:\Users\Asus\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2/tools/sdk/include/newlib/math.h:278:15: note: ‘round’

extern double round _PARAMS((double));

           ^

In file included from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/common.h:29:0,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/integer_ops/pooling.h:21,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/micro/kernels/pooling.h:23,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/micro/micro_mutable_op_resolver.h:33,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/micro/all_ops_resolver.h:19,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/classifier/inferencing_engines/tflite_helper.h:35,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/classifier/inferencing_engines/tflite_eon.h:28,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/classifier/ei_run_classifier.h:44,

             from C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/Object_Detection_TA_inferencing.h:49,

             from C:\Users\Asus\AppData\Local\Temp\arduino_modified_sketch_31264\esp32_camera.ino:27:

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h: In function ‘T tflite::TfLiteExpm1(T)’:

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:26:35: error: ‘expm1’ is not a member of ‘std’

#define TF_LITE_GLOBAL_STD_PREFIX std

                               ^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:32:12: note: in expansion of macro ‘TF_LITE_GLOBAL_STD_PREFIX’

 return TF_LITE_GLOBAL_STD_PREFIX::std_name(x);    \

        ^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:36:1: note: in expansion of macro ‘DECLARE_STD_GLOBAL_SWITCH1’

DECLARE_STD_GLOBAL_SWITCH1(TfLiteExpm1, expm1);

^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:26:35: note: suggested alternative:

#define TF_LITE_GLOBAL_STD_PREFIX std

                               ^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:32:12: note: in expansion of macro ‘TF_LITE_GLOBAL_STD_PREFIX’

 return TF_LITE_GLOBAL_STD_PREFIX::std_name(x);    \

        ^

C:\Users\Asus\OneDrive\Dokumen\Arduino\libraries\Object_Detection_TA_inferencing\src/edge-impulse-sdk/tensorflow/lite/kernels/internal/cppmath.h:36:1: note: in expansion of macro ‘DECLARE_STD_GLOBAL_SWITCH1’

DECLARE_STD_GLOBAL_SWITCH1(TfLiteExpm1, expm1);

^

In file included from C:\Users\Asus\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32/esp32-hal.h:34:0,

             from C:\Users\Asus\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32/Arduino.h:35,

             from sketch\esp32_camera.ino.cpp:1:

C:\Users\Asus\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2/tools/sdk/include/newlib/math.h:290:15: note: ‘expm1’

extern double expm1 _PARAMS((double));

           ^

C:\Users\Asus\AppData\Local\Temp\arduino_modified_sketch_31264\esp32_camera.ino: At global scope:

esp32_camera:119:20: error: ‘CAMERA_FB_IN_PSRAM’ was not declared in this scope

 .fb_location = CAMERA_FB_IN_PSRAM,

                ^

esp32_camera:120:18: error: ‘CAMERA_GRAB_WHEN_EMPTY’ was not declared in this scope

 .grab_mode = CAMERA_GRAB_WHEN_EMPTY,

              ^

esp32_camera:121:1: error: ‘camera_config_t’ has no non-static data member named ‘fb_location’

};

^

exit status 1

‘CAMERA_FB_IN_PSRAM’ was not declared in this scope

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

Hi @Oddie711,

I cannot replicate the error. Could you try Arduino 2.x and see if it works for you? I got it to compile on Arduino 2.2.1 with the AI Thinker ESP32-CAM board selected.