请教一个cmakelist.txt 编辑问题
Posted: Sun Mar 07, 2021 2:57 pm
尝试把helloworld的函数独立写一个components出来但是遇到以下问题
红字部分应该如下解决 已经在REQUIRES添加
hi里面cmakelist如下
idf_component_register(SRCS "hi.c"
INCLUDE_DIRS "."
REQUIRES esp_spi_flash
)
main 里面cmakelist 如下
idf_component_register(SRCS "hello_world_main.c"
INCLUDE_DIRS "")
- $ cmake
- -- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.30.0.windows.2")
- -- The C compiler identification is GNU 8.4.0
- -- The CXX compiler identification is GNU 8.4.0
- -- The ASM compiler identification is GNU
- -- Found assembler: G:/work/esp/esp32/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
- -- Check for working C compiler: G:/work/esp/esp32/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
- -- Check for working C compiler: G:/work/esp/esp32/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe -- works
- -- Detecting C compiler ABI info
- -- Detecting C compiler ABI info - done
- -- Detecting C compile features
- -- Detecting C compile features - done
- -- Check for working CXX compiler: G:/work/esp/esp32/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe
- -- Check for working CXX compiler: G:/work/esp/esp32/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe -- works
- -- Detecting CXX compiler ABI info
- -- Detecting CXX compiler ABI info - done
- -- Detecting CXX compile features
- -- Detecting CXX compile features - done
- -- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
- -- Building ESP-IDF components for target esp32
- -- Checking Python dependencies...
- Python requirements from g:\work\esp\esp32\esp-idf\requirements.txt are satisfied.
- CMake Error at G:/work/esp/esp32/esp-idf/tools/cmake/build.cmake:191 (message):
- Failed to resolve component 'esp_spi_flash'.
- Call Stack (most recent call first):
- G:/work/esp/esp32/esp-idf/tools/cmake/build.cmake:217 (__build_resolve_and_add_req)
- G:/work/esp/esp32/esp-idf/tools/cmake/build.cmake:437 (__build_expand_requirements)
- G:/work/esp/esp32/esp-idf/tools/cmake/project.cmake:396 (idf_build_process)
- CMakeLists.txt:6 (project)
idf_component_register(SRCS "hi.c"
INCLUDE_DIRS "."
REQUIRES esp_spi_flash
)
main 里面cmakelist 如下
idf_component_register(SRCS "hello_world_main.c"
INCLUDE_DIRS "")
- C:.
- │ CMakeLists.txt
- │ example_test.py
- │ Makefile
- │ README.md
- │ sdkconfig
- │
- ├─.vscode
- │ c_cpp_properties.json
- │ launch.json
- │ settings.json
- │ tasks.json
- │
- ├─components
- │ └─hi
- │ CMakeLists.txt
- │ hi.c
- │ hi.h
- │
- └─main
- CMakeLists.txt
- component.mk
- hello_world_main.c