Include component header
Posted: Tue May 14, 2024 4:00 pm
Hello,
I started a new project using the "ledc_basic_example" template. The main includes "driver/ledc.h" end everything build fine.
Then I added a component. I include the component header, let say "mycomponent.h" into the main, but when compiling this header is not found. So I changed the CMakeLists.txt placed into "led_basic/main/" folder to include my component.
As described in a previous thread I tried both
and
At this point the driver/ledc.h is not found.
Why?
I started a new project using the "ledc_basic_example" template. The main includes "driver/ledc.h" end everything build fine.
Then I added a component. I include the component header, let say "mycomponent.h" into the main, but when compiling this header is not found. So I changed the CMakeLists.txt placed into "led_basic/main/" folder to include my component.
As described in a previous thread I tried both
Code: Select all
idf_component_register(SRCS "main.c"
INCLUDE_DIRS "."
PRIV_REQUIRES my_component)
Code: Select all
set(includedirs
../components/my_component/include/
"." # this line is probably not needed since main dir is included by default and there are no sub-directories under main
)
idf_component_register(SRCS "main.c"
INCLUDE_DIRS ${includedirs}
PRIV_REQUIRES my_component)
Why?