I'm currently in the process of migrating my dependencies for my project to use the component manager, but I've encountered a problem where one my github dependencies relies on driver/gpio.h, but I get a build error that the import cannot be found ( No such file or directory
). The dependency in question is , which imports driver/gpio.h
in its header file.
I've tried adding REQUIRES driver
to my CMakeLists.txt, as well as adding these lines to my idf_component.yml:
driver:
version: '*'
enter code here
What's also odd is that I appear to be able to import driver/gpio.h
in my local code without problems. I even tried importing it just before the import for the esp32-rotary-encoder header file, which from I understand should satisfy the dependency, but without success. Really baffled as to what the issue is.
The full build output and error:
[1/12] Performing build step for 'bootloader'
[1/1] cd <project_path>/build/bootloader/esp-idf/esptool_py && <pypath>/python <esp_path>/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 <project_path>/build/bootloader/bootloader.bin
Bootloader binary size 0x6840 bytes. 0x7c0 bytes (7%) free.
[4/12] Building C object esp-idf/esp32-rotary-encoder/CMakeFiles/__idf_esp32-rotary-encoder.dir/rotary_encoder.c.obj
FAILED: esp-idf/esp32-rotary-encoder/CMakeFiles/__idf_esp32-rotary-encoder.dir/rotary_encoder.c.obj
~/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc -DESP_PLATFORM -DIDF_VER=\"v5.2.2\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I<project_path>/build/config -I<project_path>/managed_components/esp32-rotary-encoder/include -I<esp_path>/esp-idf/components/newlib/platform_include -I<esp_path>/esp-idf/components/freertos/config/include -I<esp_path>/esp-idf/components/freertos/config/include/freertos -I<esp_path>/esp-idf/components/freertos/config/xtensa/include -I<esp_path>/esp-idf/components/freertos/FreeRTOS-Kernel/include -I<esp_path>/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I<esp_path>/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -I<esp_path>/esp-idf/components/freertos/esp_additions/include -I<esp_path>/esp-idf/components/esp_hw_support/include -I<esp_path>/esp-idf/components/esp_hw_support/include/soc -I<esp_path>/esp-idf/components/esp_hw_support/include/soc/esp32 -I<esp_path>/esp-idf/components/esp_hw_support/port/esp32/. -I<esp_path>/esp-idf/components/heap/include -I<esp_path>/esp-idf/components/log/include -I<esp_path>/esp-idf/components/soc/include -I<esp_path>/esp-idf/components/soc/esp32 -I<esp_path>/esp-idf/components/soc/esp32/include -I<esp_path>/esp-idf/components/hal/platform_port/include -I<esp_path>/esp-idf/components/hal/esp32/include -I<esp_path>/esp-idf/components/hal/include -I<esp_path>/esp-idf/components/esp_rom/include -I<esp_path>/esp-idf/components/esp_rom/include/esp32 -I<esp_path>/esp-idf/components/esp_rom/esp32 -I<esp_path>/esp-idf/components/esp_common/include -I<esp_path>/esp-idf/components/esp_system/include -I<esp_path>/esp-idf/components/esp_system/port/soc -I<esp_path>/esp-idf/components/esp_system/port/include/private -I<esp_path>/esp-idf/components/xtensa/esp32/include -I<esp_path>/esp-idf/components/xtensa/include -I<esp_path>/esp-idf/components/xtensa/deprecated_include -I<esp_path>/esp-idf/components/lwip/include -I<esp_path>/esp-idf/components/lwip/include/apps -I<esp_path>/esp-idf/components/lwip/include/apps/sntp -I<esp_path>/esp-idf/components/lwip/lwip/src/include -I<esp_path>/esp-idf/components/lwip/port/include -I<esp_path>/esp-idf/components/lwip/port/freertos/include -I<esp_path>/esp-idf/components/lwip/port/esp32xx/include -I<esp_path>/esp-idf/components/lwip/port/esp32xx/include/arch -I<esp_path>/esp-idf/components/lwip/port/esp32xx/include/sys -mlongcalls -Wno-frame-address -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -fdiagnostics-color=always -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -Og -fno-shrink-wrap -fmacro-prefix-map=<project_path>=. -fmacro-prefix-map=<esp_path>/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -MD -MT esp-idf/esp32-rotary-encoder/CMakeFiles/__idf_esp32-rotary-encoder.dir/rotary_encoder.c.obj -MF esp-idf/esp32-rotary-encoder/CMakeFiles/__idf_esp32-rotary-encoder.dir/rotary_encoder.c.obj.d -o esp-idf/esp32-rotary-encoder/CMakeFiles/__idf_esp32-rotary-encoder.dir/rotary_encoder.c.obj -c <project_path>/managed_components/esp32-rotary-encoder/rotary_encoder.c
In file included from <project_path>/managed_components/esp32-rotary-encoder/rotary_encoder.c:90:
<project_path>/managed_components/esp32-rotary-encoder/include/rotary_encoder.h:47:10: fatal error: driver/gpio.h: No such file or directory
47 | #include "driver/gpio.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
[5/12] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/controls/controls.c.obj
ninja: build stopped: subcommand failed.
I'm using the ESP-IDF extension for VSCode.