Go Down

Topic: Arduino Pro Mini + 1.0 RC2 + RF24 (Read 2724 times) previous topic - next topic

jopiek

For my students I'm testing RF24 with Arduino 1.0 RC 2

I am getting strange errors:
SPI/SPI.h

Arduino.h: No such file or directory

Arduino.h is there in hardware/arduino/cores/arduino (inside Arduino app on my Mac).
So any idea on how this issue is happening and so how to solve it?! (Except by putting the Arduino.h file and all other dependent files in libraries...)
it just doesn't seem to be able to find the core files.

Paul Stoffregen

Arduino 1.0 renamed the header files, which breaks nearly all 3rd party libraries.

Usually replacing any includes of WProgram.h with this solves the problem:

#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

Do you have a current build?

RF24.cpp has this:

Code: [Select]

#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif


Perhaps you could post the entire output from the compiler (hold down shift when you press 'verify').

Also, if you find any probs using RF24, please feel free to open an issue on github.

emili

I think this is the easiest way to solve the problem:

To update old cores (such as Sanguino)
Code: [Select]
echo "#include \"WProgram.h\"" > hardware/Sanguino/cores/arduino/Arduino.h

To compile old programs on new cores (>=1.0)
Code: [Select]
echo "#include \"Arduino.h\"" > hardware/arduino/cores/arduino/WProgram.h

(You've got them backwards by the way).

As a library writer, you cannot expect users to modify their core.  So the library has to solve the Arduino.h/WProgram.h problem itself anyway.

Go Up