Why does sketch using SD.h suddenly need #include <SPI.h> to compile?

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.

You will have to post your program if you want an answer.

Either there is a call to a function from the SPI library or there is a typo that makes the compiler think there is a call to the SPI library.

...R

Read the third bullet point:

http://arduino.land/FAQ/content/1/3/en/what-does-the-ide-change-in-my-sketch.html

The SD card uses SPI for its communication.

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.

Best,
Adrian

CardInfo.ino (3.47 KB)

pYro_65:
Read the third bullet point:

http://arduino.land/FAQ/content/1/3/en/what-does-the-ide-change-in-my-sketch.html

The SD card uses SPI for its communication.

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!

Thanks again!

-jim lee