I am a bit confused on the library selection procedure:
First:
I am still using Arduino 0023 because I use chipKit MAX32 boards
running on windows 7
The base libraries can be found in the C:...\mpide-0023-windows-20120903\hardware section
My project can be found in C:\Users...\Documents\Arduino
I have a library directory in C:\Users...\Documents\Arduino\libraries
If I build a project, lets say ProjectA, it will be in C:\Users...\Documents\Arduino\ProjectA.
In this project I use a library, lets say libA, in C:\Users...\Documents\Arduino\libraries\libA
In this last directory we will see libA.h and libA.cpp
Lets assume we have a second library, libB with the file libB.h and libB.cpp.
We will find them in C:\Users...\Documents\Arduino\libraries\libB
Now the problem:
assume I want to use libB in libA which is used in projectA
projectA.h has a line #include <libA.h>
libA.h has a line #include <libB.h>
If I compile ProjectA libA.h will be found but I receive a "file not found" error on libB.h
if I put the line #include <../libB/libB.h> into libA.h I receive errors on undefined functions of libB at link time.
if I put libB.h and libB.cpp into the directory of ProjectA everythings works.
Yes, I restarted the IDE everytime I changed something in the directory hiereachy e.g. moving/creating files
Any hints?
Is there a property which tell the system where to look for libraries and how deep into the hierarchy?
hobermallow:
Is there a property which tell the system where to look for libraries and how deep into the hierarchy?
No. The problem is that the Arduino IDE collects together all the files it thinks you need in your project before it invokes the compiler. It works out which library files you need based on the header files that you #included into your main sketch .ino file. If you want to include a library in your sketch then you must#include the appropriate header into your main sketch .ino file. (Yes, I think it's a daft system too.)
that's what I was afraid of. But: look at the libs which are in the IDEs hardware section.
for example wiring.h in arduino has the following lines #ifndef Wiring_h #define Wiring_h
that's what I was afraid of. But: look at the libs which are in the IDEs hardware section.
for example wiring.h in arduino has the following lines #ifndef Wiring_h #define Wiring_h
which obviously hides the libs stdlib and binary from the scetch
And, where does wiring.h get included? Which version of the IDE still has wiring.h? Only 0023 and earlier. And, wiring.h is included in WProgram.h, which the IDE includes in every sketch.
So, stdlib.h and binary.h are NOT hidden from the sketch.