Hopefully one of our resident Experts can explain this for me!
Naon V3.0 IDE 1.0.5 Catalex MicroSD Card Adapter ICSP bus
Sketches which interface with an SD card reader (e.g. standard example Cardinfo), suddenly stopped compiling:
SD/utility/Sd2Card.cpp.o: In function Sd2Card::setSckRate(unsigned char)': /Users/adrianland/Documents/Arduino/libraries/SD/utility/Sd2Card.cpp:585: undefined reference to SPIClass::setClockDivider(unsigned char)'
…etc…
Adding: #include <SPI.h>
Seems to fix the problem, but why this problem came out of nowhere, and why I now need the extra #include, concerns me!
Any guidance much appreciated.
Thanks for the responses. I've checked out the FAQ section; most interesting, but I'm not sure this addresses the problem I'm seeing!
On Tuesday, files compile, on Wednesday, the same files don't...
I appreciate that 'behind the scenes' the IDE adds standard libraries into the code for compilation; but, what could have happened to require the standard <SPI.h> library to be explicitly included in the sketch?
I've attached one of the standard example files Cardinfo.ino which shows this problem.
Hey thanks for that! That was the best explanation of the IDE #ifdef & #include madness I've ever seen! I've been fighting this issue in ignorance for what seems like forever!
Add char dummy; to the top to trick the pre-pre-compiler. Slick, just slick!