I'm using IDE 2.0 RC5
I would like to be able to collect some like library files in a subfolder in the Library. Is this possible?
I've tried:
#include
#include <subfolder/DS3232RTC>
#include "subfolder/DS3232RTC"
all the above result in a fatal error " No such file or directory"
Thanks
in0
March 25, 2022, 8:06am
3
Tut tut. 3.7k posts and you still aren't using code blocks?
Only the files in the root of the source code folder of the library are used by the Arduino build system's library discovery process . Discovered libraries are added to the compiler's include search path, so after an #include
for a file in the root of the source code folder, you can then add #include
directives for files in subfolders.
For example. If I have this library:
<sketchbook folder>/
└── libraries/
└── FooLib/
├── library.properties
└── src/
├── FooLib.h
└── subfolder/
└── Bar.h
I can't do this:
#include <subfolder/Bar.h>
But I can do this:
#include <FooLib.h>
#include <subfolder/Bar.h>
There is a feature request to expand the scope of the discovery process:
opened 12:56AM - 02 May 21 UTC
closed 09:29AM - 14 Dec 22 UTC
type: enhancement
conclusion: resolved
topic: code
## Bug Report
### Current behavior
If I just include
`#include "encoders/… as5048a/MagneticSensorAS5048A.h"`
library detection fails and (obviously) compilation isn't possible.
If I add a "Dummy.h" to the top level (src folder) of my library, and include that in my sketch, library detection succeeds.
### Expected behavior
I'd expect the library detection to succeed, no matter what header I include from the library. Or I'd expect a way to explicitly include a library (is there one? I haven't found it :-( ).
### Environment
- CLI version (output of `arduino-cli version`):
Version: 2.0.0-beta.5
Date: 2021-04-15T10:43:43.670Z (2 weeks ago)
CLI Version: 0.18.1 alpha [b3cf8e19]
- OS and platform: Mac OS Big Sur
### Additional context
And maybe somewhat related is this request for the possibility of organizing libraries into subfolders instead of all of them having to be in the root of the libraries
folder:
opened 01:08PM - 29 Mar 18 UTC
type: enhancement
I currently have well over a hundred libraries accumulated. I'm sure many activ… e users have even more! It getting clumsy to sort thru them by eye! It would be very helpful if there was a way to have a hierarchical menu system so Libraries could be sorted into folders with meaningful names, and easier to find.
I suspect this might make it harder/slower for the libraries to be found by the IDE. But the the vast wealth of libraries available - it might be worth it!
thank you
Tut tut. 3.7k posts and you still aren't using code blocks?
Yea I know Although when I posted it I wasn't thinking of it as code, only lines of "code"?
system
Closed
September 21, 2022, 4:11pm
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.