vincent
vincent

Reputation: 1

How to resolve CMakeLists.txt error in visual studio (ninja build error)

I am working on a project with an ESP32 WROOM32 and trying to use two UARTS, we can get the first one to work and output data, but the second one not so much. I am currently trying to compile my code and i ran into this error?

error:

CMake Error at C:/Users/DeLorenzoVincent/esp-idf/tools/cmake/component.cmake:451 (message):
  Called idf_component_register from a non-component directory.
Call Stack (most recent call first):
  CMakeLists.txt:11 (idf_component_register)


-- Configuring incomplete, errors occurred!
ninja: error: rebuilding 'build.ninja': subcommand failed

FAILED: build.ninja
C:\Users\DeLorenzoVincent\.espressif\tools\cmake\3.30.2\bin\cmake.exe --regenerate-during-build -SC:\Users\DeLorenzoVincent\esp-idf\Capstone -BC:\Users\DeLorenzoVincent\esp-idf\Capstone\build

 *  The terminal process "c:\Users\DeLorenzoVincent\.espressif\tools\ninja\1.12.1\ninja.exe" terminated with exit code: 1.

My CMakeLists.txt file is below:

# Minimum CMake version requirement
cmake_minimum_required(VERSION 3.30)

# Include ESP-IDF's project.cmake to use its build system
include(C:/Users/DeLorenzoVincent/esp-idf/tools/cmake/project.cmake)

#name 
project(Capstone)

# Register the components with their source files and include directories
idf_component_register(SRCS "uartEsc.c" "pid.c" "esc.c" "main.c" "i2c.c"
                       INCLUDE_DIRS ".")

I have tried using idf.py fullclean and building it Verifying my versions are up to date exporting and importing .\bat and my main includes everything necessary

Upvotes: 0

Views: 140

Answers (0)

Related Questions