I am working on a rather large project (ESP32 / Arduino framework).
I now have 12+ modules such as ‘touchscreen’, ‘network’, ‘filesystem’, etc. and each of these modules are in separate folder / files under the folder ‘lib’. Of course these modules interact a lot, so many modules include the header files of other modules. Finally these modules use many built-in libraries such as WiFi.h etc. so these are also included.
I already have lib_deps = WiFi
and I have lib_ldf_mode = chain+
but still I am running into problems when the compiler doesn’t find header files, which are obviously there, because you can simply ctrl+click on them and they open…
QUESTION : Instead of relying on the magic of the LDF, is there not a more robust, manual way of defining all libraries…
own in ‘lib’ folder (12+ subfolders)
on github (5 libraries)
built-in, eg. ESP32-Arduino framework
…so that these include errors are a thing of the past.
I think it would also build faster that way because the LDF (chain+) takes quite some time now.
Are there any examples / docs / blogposts on how to do this ? I think it’s a must have for professional. large project developments.
sorry for my late reply, I was on a sailing trip with no internet.
People from Platformio have investigated my example, and I’ve come to the following conclusion : my problem mainly occurs because of so-called circular include statements:
A.h includes B.h
B.h includes A.h
This should be OK if there are header guards, or #pragma once (which I am using nowadays).
However, I have the feeling that Platformio Library Finder (LDF) does not like this circular includes and may give up at some stage, not including important other stuff…
So the solution is not so difficult : extract everything which is common for A.h and B.h into a separate C.h so that