Main file cannot view includes in another file
Posted: Mon Nov 04, 2024 11:20 pm
Hello,
I have a project with the following organization:
.
├── CMakeLists.txt
├── app
│ ├── inc
│ │ └── app_default.h
│ ├── src
│ │ └── dummy.c
│ └── CMakeLists.txt
├── main
│ ├── CMakeLists.txt
│ └── main.c
└── srv
├── inc
└── src
Root CMakelists.xtx:
Main folder CMakeLists.txt:
App folder CMakeLists.txt:
But I get the following error:
C:/Users/Yan/Documents/GitHub/univali-iot-node-sensor/main/main.c:34:10: fatal error: app_default.h: No such file or directory
#include "app_default.h"
^~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [/c/Espressif/ESP8266_RTOS_SDK/make/component_wrapper.mk:292: main.o] Error 1
make: *** [C:\Espressif\ESP8266_RTOS_SDK/make/project.mk:571: component-main-build] Error 2
make: *** Waiting for unfinished jobs....
What could I be doing wrong?
I have a project with the following organization:
.
├── CMakeLists.txt
├── app
│ ├── inc
│ │ └── app_default.h
│ ├── src
│ │ └── dummy.c
│ └── CMakeLists.txt
├── main
│ ├── CMakeLists.txt
│ └── main.c
└── srv
├── inc
└── src
Root CMakelists.xtx:
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.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(bme280_i2c)
Code: Select all
set(srcs "main.c")
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS "."
PRIV_REQUIRES app srv)
Code: Select all
idf_component_register(
INCLUDE_DIRS "inc"
)
C:/Users/Yan/Documents/GitHub/univali-iot-node-sensor/main/main.c:34:10: fatal error: app_default.h: No such file or directory
#include "app_default.h"
^~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [/c/Espressif/ESP8266_RTOS_SDK/make/component_wrapper.mk:292: main.o] Error 1
make: *** [C:\Espressif\ESP8266_RTOS_SDK/make/project.mk:571: component-main-build] Error 2
make: *** Waiting for unfinished jobs....
What could I be doing wrong?