Hi,
I’m currently having some issues with a rather large project I’m working on. My main library which is the core of the whole project is split into many files, which are partially located in two or even three folders deep within the directory tree. This is obviously giving me include errors because PIO doesn’t seem to look more than one level deep for include files.
My IDE is VSCode, the folder structure looks like in the attached screenshot:
main.cpp should include Core1.h which is in the main directory “MyCoreLib” of the library.
Core1.h in turn includes stuff from the directories “modules” and “includes” and files withing the “modules” folder (like Module1.h, Module1.cpp) include stuff from the folder “includes” which is nested even one level deeper.
lib_extra_dirs
has been set to the path of the Libraries folder.
Currently there is no situation where I go one level up like using …/ and such, I’m always only going deeper in the hierarchy when including stuff. Also, the library never includes stuff from “Project1”, obviously. However, Project1 might have to include stuff from the library’s “Includes” folder, deep down in the structure.
How is this done with PIO, or what would be another solution to this? I would prefer to NOT have all files in one folder as that would get messy and confusing very quickly, looking at the amount of files.
PS: just to maybe put more clarity into this, the library has multiple “Core1, Core2, Core3, …” cpp and h files because each of those core files implements different functionality composed from the modules in the “Modules” folder. A project like “Project1” in this example, will always include only one of the “Core1, …” .h files. Project2 might include Core2.h and so on.
edit2: maybe set lib_ldf_mode
to deep or even deep+ would help? although the manual says this is generally not recommended…
Thanks for your help!