Go Down

Topic: Problems With Include File Dependencies (Read 218 times) previous topic - next topic


I am writing a library (let's call it Two.h) which depends on another one of my user libraries (let's call it One.h).  In Two.h, it properly includes One.h.  The problem is that when someone goes to use Two.h in a sketch, they will get compiler errors because the IDE did not add the include path to One.h.  The only way to make it work is to include One.h in the sketch.  How is the person using Two.h supposed to know that they need to add One.h as well?  If the IDE is going to manage include paths, it needs to be smart enough to search the included header files for more libraries which need to be added to the include paths.  Am I missing something?


Unfortunately, its the way the IDE does it.

For now, this is the way it'll be, I'm sure they have plans to one day incorporate a full recursive scan.
You will, for now, have to ensure appropriate documentation is included in the library, and also in any examples.

I have written an article describing some of the IDE's behaviors ( including this one )  if you are interested. There are also links to some examples where the IDE can break your code because of these changes.

Go Up