Pages: [1]   Go Down
Author Topic: Problems With Include File Dependencies  (Read 184 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 74
Posts: 2214
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
http://arduino.land/FAQ/content/1/3/en/what-does-the-ide-change-in-my-sketch.html
Logged


Pages: [1]   Go Up
Jump to: