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

morty12138
Posts: 2
Joined: Thu Oct 15, 2020 4:34 am

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

Postby morty12138 » Thu Oct 15, 2020 4:38 am

从github下载的esp32-cam程序在esp-idf和eclipse下编译出错,错误信息为
CMake Error at CMakeLists.txt:34 (register_component):
Unknown CMake command "register_component".

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

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

Postby ESP_morris » Thu Oct 15, 2020 10:13 am

这个是IDF中自定义的Cmake函数,初步怀疑你的{IDF_PATH}环境变量没有设置正确

morty12138
Posts: 2
Joined: Thu Oct 15, 2020 4:34 am

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

Postby morty12138 » Thu Oct 15, 2020 1:21 pm

谢谢回复,我把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)

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

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

Postby ESP_morris » Fri Oct 16, 2020 3:38 am

Called idf_component_register from a non-component directory.“
只能在组建的Cmake文件中调用idf_component_register

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

Who is online

Users browsing this forum: No registered users and 97 guests