src folder in sketch structure and include library from subfolder

My Arduino/PlatformIO libraries folder

libraries
l_cleaner_robot
l_TB6612_Dual
l_tb6612_dual.h
l_tb6612_dual.cpp

I used this code to innclude it:

#include <TB6612_Dual/tb6612_dual.h>

But the compilation has errors like "undefinded variables, undefinded reference,...etc"

This is my sketch folder

Cleaner_Robot
l_src
l_TB6612_Dual
l_tb6612_dual.cpp
l_tb6612_dual.h

If i use this code, all is ok

#include "src/libs/TB6612_Dual/tb6612_dual.h"

So the question is how to include if header file is in a sub folder of a folder in libraries folder of Arduino/PlatformIO ?, i has searched for many things, but cant help.
I also read about src folder allowed in Arduino, but where can find an official announcement/manual for this structure ?, cant find much about this

Thanks :slight_smile:

Recursive compilation is only done inside the src folder. This is called the 1.5 Arduino library format. So your library would need to look like this:

libraries
|_cleaner_robot
   |_library.properties
   |_src
      |_cleaner_robot.h
      |_TB6612_Dual
         |_tb6612_dual.h
         |_tb6612_dual.cpp

Then you can do this:

#include <cleaner_robot.h>
#include <TB6612_Dual/tb6612_dual.h>

m4u_hoahoctro:
I also read about src folder allowed in Arduino, but where can find an official announcement/manual for this structure ?, cant find much about this

The 1.5 Arduino library format is documented here:
https://arduino.github.io/arduino-cli/latest/library-specification/#source-code

The src subfolder of the sketch is documented here:
https://arduino.github.io/arduino-cli/latest/sketch-specification/#src-subfolder