Unable to add led_strip.h

DutchOrange
Posts: 74
Joined: Fri Dec 04, 2020 4:23 pm

Unable to add led_strip.h

Postby DutchOrange » Mon Apr 12, 2021 2:41 pm

Good day.
So I was trying to add the library to my project but what ever I do it keeps saying:
../main/get_started.c:20:10: fatal error: led_strip.h: No such file or directory
#include <led_strip.h>
Here is the CmakeLits.txt:

Code: Select all

# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

set(EXTRA_COMPONENT_DIRS $ENV{MDF_PATH}/esp-idf-lib/components)

include($ENV{MDF_PATH}/project.cmake)
#include($ENV{MDF_PATH}/tools/cmake/project.cmake)


project(get_started)
And the Cmake in the Main folder:

Code: Select all

idf_component_register(SRCS "get_started.c"
                    INCLUDE_DIRS ""
                    REQUIRES mcommon mconfig mwifi mlink
)
And finally here is the error code:

Code: Select all

R=\"v1.0-129-g4555f06-dirty\" -DESP_PLATFORM -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/get_started.c.obj -MF esp-idf\main\CMakeFiles\__idf_main.dir\get_started.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/get_started.c.obj   -c ../main/get_started.c
../main/get_started.c:20:10: fatal error: led_strip.h: No such file or directory
 #include <led_strip.h>
          ^~~~~~~~~~~~~
compilation terminated.
[966/972] Building C object esp-idf/mdebug/CMakeFiles/__idf_mdebug.dir/mdebug_cmd.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
(I have made a post awhile agao but I tried it again but no luck)

Any help will appreciated. Thanks.

超级小星星123
Posts: 11
Joined: Fri Oct 21, 2022 9:36 am

Re: Unable to add led_strip.h

Postby 超级小星星123 » Fri Dec 30, 2022 9:12 am

在根目录下的CMakeLists.txt中添加组件就可以了

Code: Select all

set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/led_strip)

Who is online

Users browsing this forum: No registered users and 331 guests