Page 1 of 1

[求助]esp32-cam程序编译出错

Posted: Thu Oct 15, 2020 4:38 am
by morty12138
从github下载的esp32-cam程序在esp-idf和eclipse下编译出错,错误信息为
CMake Error at CMakeLists.txt:34 (register_component):
Unknown CMake command "register_component".

Re: [求助]esp32-cam程序编译出错

Posted: Thu Oct 15, 2020 10:13 am
by ESP_morris
这个是IDF中自定义的Cmake函数,初步怀疑你的{IDF_PATH}环境变量没有设置正确

Re: [求助]esp32-cam程序编译出错

Posted: Thu Oct 15, 2020 1:21 pm
by morty12138
谢谢回复,我把helloworld例程里的
# 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)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(hello-world)
复制进工程cmakelist.txt中,仍然报错
CMake Error at C:/Users/Liuhaipeng/Desktop/esp-idf/tools/cmake/component.cmake:430 (message):
Called idf_component_register from a non-component directory.
Call Stack (most recent call first):
C:/Users/Liuhaipeng/Desktop/esp-idf/tools/cmake/component.cmake:536 (idf_component_register)
CMakeLists.txt:41 (register_component)

Re: [求助]esp32-cam程序编译出错

Posted: Fri Oct 16, 2020 3:38 am
by ESP_morris
Called idf_component_register from a non-component directory.“
只能在组建的Cmake文件中调用idf_component_register

IDF的Cmake构建系统文档:https://docs.espressif.com/projects/esp ... ystem.html