nicoverduin:
Hi Jantje
For Eclipse we include the .h file with the references to setup and loop and any functions we use. Which btw is neat programming as far as I am concerned
In the Arduino we can skip all this.
And a couple of my customers just want the sketch and that's it. So now I solve it this way:#ifdef __IN_ECLIPSE__
#include "test.h"
#endif
Then it always works
I'm a bit confused here. IMHO Arduino does not do "pre processing" of the library files. So for libraries you are down to C/C++ including the need of function definitions before function usage.
For sketches the only file arduino includes behind your back is arduino.h. All the libraries need a include in the ino file. If not Arduino can not calculate the build and include path.
So IMHO
#ifdef __IN_ECLIPSE__
#include "test.h"
#endif
can always be replaced with
#include "test.h"
when test.h has the double include protection like
#ifndef _[HEADERNAME]_H_
#define _[HEADERNAME]_H_
//Your code goes here
#endif
If I'm wrong please tell me.
Note that I created the IN_ECLIPSE define and I never used it. I'm not even sure V2 of the plugin still defines it.
So if there is a need I would like to know so I can make sure it stays in (or gets back into) the plugin.
Best regards
Jantje