Using libraries in ESP-IDF

I am trying to add a private library to a project in Platformio. I’m using the ESP-IDF framework, and I have started with the blink example.

The example compiles just fine, but if I try to add a “utils” library in the lib folder and include it inside the main file, I get an error telling me src\blink.c:15:10: fatal error: utils.h: No such file or directory.

I have developed a project in the past using an older version of the framework that was not based on CMake, and I was able to place private libraries in the lib folder and use them inside my project. It looks like this is not working anymore in the current version of the framework.

This is how my project folder looks:

├───include
│       README
├───lib
│   │   README
│   └───utils
│           utils.h
└───src
        blink.c
        CMakeLists.txt

How can I add and use private libraries from the lib directory?

Duplicate of PlatformIO can`t find library headers after ESP32 dev-platform 1.12.0 update - #2 by maxgerhardt

1 Like