Newbie - Can't include component header

I’ve taken an example someone has done online (GitHub - pantaluna/esp32_ds3231_32khz_oscillator_using_lib) and I’m trying to get it to compile under PIO - sadly I’m failing with a fatal error on including a component header file and despite reading the build documentation I’m still failing! Any help would be hugely appreciated…

All components are in a components folder, with subfolders for each component.

There’s my structure. The .h file in question is in the “include” folder of “mjd”. There are others too but I’m assuming I fix the first one, I’ll fix the rest.

My “src” CMakeLists.txt looks like this:

# This file was automatically generated for projects
# without default 'CMakeLists.txt' file.

FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*)

idf_component_register(SRCS ${app_sources})

My root CMakeLists.txt looks like this:

cmake_minimum_required(VERSION 3.16.0)

And then the error I get looks like this…


The formatting in main.c indicates it’s failing to find them, but I have no idea why (red underline under the #include entries for all 4 components.

I realise I’m probably making some very basic error somewhere, but I’d really appreciate it if anyone could help please.

Thank you in advance.

Try renaming components/ to the platformio compatible lib/ and the main/ to src/.

Otherwise create a new platformio project and read the README files in each folder, they describe pretty good what to place where.