Error detecting esp32-camera library at compilation level

Hi,

I’m trying to create a project using the ESP32CAM AI Thinker in the PlatformIO environment integrated with VS Code and espidf framework.

The problem is that I can include the esp-camera.h (and I can access the header) in my project, and it takes me to all the functions while developing the project. However, when trying to compile, I get errors like the functions are not defined

My platform.ini is configured as follows:

[platformio]
default_envs = release

;*******************************************************************************************************
[env]
platform = espressif32 @ 6.10.0
board = esp32cam
framework = espidf
monitor_speed = 115200
lib_deps =
esp32-camera
Universal-Arduino-Telegram-Bot
cJSON
ArduinoJson@6.18.5
;lib_extra_dirs =
; ${PROJECT_DIR}/lib/esp32-camera
build_flags =
-DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
-DARDUINOJSON_USE_LONG_LONG=1
-DARDUINOJSON_ENABLE_COMMENTS=1
-DARDUINOJSON_ENABLE_NAN=1
-DARDUINOJSON_ENABLE_INFINITY=1
;-DUSE_TELEGRAM
-DUSE_WIFI
-DCONFIG_SCCB_CLK_FREQ=100000
-DCONFIG_CAMERA_JPEG_MODE_FRAME_SIZE_AUTO
-DCONFIG_IDF_TARGET_ESP32

;*******************************************************************************************************
[env:release]
extends = env
build_type = release
lib_deps = ${env.lib_deps}
build_flags = ${env.build_flags}

;*******************************************************************************************************
[env:debug]
extends = env
build_type = debug
debug_tool = esp-prog
upload_protocol = esp-prog
build_flags =
${env.build_flags}
-DCORE_DEBUG_LEVEL=5

(libdeps with = “github link”)
And I get the aforementioned error. I have also tried cloning the library directly into lib/ and executing the same steps.

If anyone has any idea where the error might be coming from when including the esp32-camera library, it would be greatly appreciated. Thanks!Preformatted text

The output of this problem is that:

C:/Users/roque/.platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld.exe: .pio/build/release/lib554/libesp32-camera.a(cam_hal.o):(.literal.cam_start_frame+0x4): undefined reference to `ll_cam_start’

C:/Users/roque/.platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld.exe: .pio/build/release/lib554/libesp32-camera.a(cam_hal.o):(.literal.cam_start_frame+0x8): undefined reference to `ll_cam_do_vsync’

C:/Users/roque/.platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld.exe: .pio/build/release/lib554/libesp32-camera.a(cam_hal.o):(.literal.cam_dma_config+0x38): undefined reference to `ll_cam_dma_sizes’

C:/Users/roque/.platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld.exe: .pio/build/release/lib554/libesp32-camera.a(cam_hal.o):(.literal.cam_dma_config+0x3c): undefined reference to `ll_cam_get_dma_align’

C:/Users/roque/.platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld.exe: .pio/build/release/lib554/libesp32-camera.a(cam_hal.o):(.literal.cam_init+0x14): undefined reference to `ll_cam_set_pin’

lib_deps and esp-idf framework do not play together. If you want to add the esp32-camera component, do so as an ESP-IDF component. Also it makes no sense to include Arduino libraries if you only the ESP-IDF as the framework, not Arduino.

1 Like

Thank you for your help! I will see those notes and change the scope of adding libraries.
Also, thank you for notice that it is not able to use this library, I will search other that i can handle my proyect.