1

My Arduino/PlatformIO libraries folder

libraries
└── cleaner_robot
 └── TB6612_Dual
 ├── tb6612_dual.h
 └── 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
└── src
 └── TB6612_Dual
 ├── tb6612_dual.cpp
 └── 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 :)

Edgar Bonet
45.1k4 gold badges42 silver badges81 bronze badges
asked Jul 21, 2019 at 5:36
2

1 Answer 1

2

I could include header files in subfolder after including root header file.

#include <TB6612_Dual.h>
#include <TB6612_Dual/tb6612_dual.h>
TB6612_Dual
└── src
 ├── TB6612_Dual.h << Add this empty file.
 └── TB6612_Dual
 ├── tb6612_dual.cpp
 └── tb6612_dual.h

Examples:

answered May 13, 2020 at 14:11

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.