Hi,
I have written a lot of custom libraries which are in the /lib folder so they can be unit tested (so don’t need to use test_build_project_src = true.
I have enough that I want to start moving them into subdirectories so:
When the libraries are not in the Interfaces and WirelessCommunication folders, they are included fine by #include "ClientCommunication.h", but when I move them to the above folder structure and try to include them by #include "WirelessComms/ClientCommunication.h" they aren’t found.
I have tried chain and deep LDF modes but neither seem to work.
If the folder structure is then lib -> WirelessComms -> ClientCommunication.h, the header should be included as just #include <ClientCommunication.h>, since the WirelessComms library is then in the include path.
Does the dependency graph show that the libraries are included then?
Unfortunately that doesn’t seem to have done it. Both quotation include and <> include doesn’t seem to find it and neither the WirelessComms folder or ClientCommunication header is in the dependency graph.
pio run -v | grep "ClientCommunication" also doesn’t give anything
Is there any more verbose output that I can see for the building of the dependency list or how the include list is made?
I would also like the format #include "[Category]/[header].h" if possible for cleaner looking code and also making it easier to reverse find the library files.
Does anyone else have any ideas? I am thinking I can have a script that will run and modify the include path to allow for the nested nature or else doing
lib_extra_dirs = ./lib
Should cause them to allow nesting but I’m not a fan of doing it that way.
I’m have the same approach as yours, and the same #include problem.
I am looking for a solution to manually include all libraries, io. LDF trying to do that in an automatic way.
I’m afraid I just went with the lib_extra_dirs = ./lib/sub_dir
approach.
Which does mean that the include headers don’t reflect the folder structure and organisation that I was hoping for (and being able to refer to header files with the same name in different folders) but at least it compiles