SD Library gives compilation error

I came across something I do not understand. With the compiler version 1.6.3 (checking from 1.5.0.beta) in any sketch compiled with a library of SD I get such a litany of errors:


C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:27:8: error: 'SPISettings' does not name a type static SPISettings settings; ^ C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp: In member function 'void Sd2Card::chipSelectHigh()': C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:167:9: error: 'class SPIClass' has no member named 'endTransaction' SPI.endTransaction(); ^ C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp: In member function 'void Sd2Card::chipSelectLow()': C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:176:9: error: 'class SPIClass' has no member named 'beginTransaction' SPI.beginTransaction(settings); ^ C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:176:26: error: 'settings' was not declared in this scope SPI.beginTransaction(settings); ^ C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp: In member function 'uint8_t Sd2Card::init(uint8_t, uint8_t)': C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:269:3: error: 'settings' was not declared in this scope settings = SPISettings(250000, MSBFIRST, SPI_MODE0); ^ C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:269:53: error: 'SPISettings' was not declared in this scope settings = SPISettings(250000, MSBFIRST, SPI_MODE0); ^ C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:275:7: error: 'class SPIClass' has no member named 'beginTransaction' SPI.beginTransaction(settings); ^ C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:279:7: error: 'class SPIClass' has no member named 'endTransaction' SPI.endTransaction(); ^ C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp: In member function 'uint8_t Sd2Card::setSckRate(uint8_t)': C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:518:14: error: 'settings' was not declared in this scope case 0: settings = SPISettings(25000000, MSBFIRST, SPI_MODE0); break; ^ C:\Program Files\Arduino\libraries\SD\src\utility\Sd2Card.cpp:518:66: error: 'SPISettings' was not declared in this scope case 0: settings = SPISettings(25000000, MSBFIRST, SPI_MODE0); break; ^ Multiple libraries were found for "SPI.h" Used: C:\Documents and Settings\kuba\Moje dokumenty\Arduino\libraries\SPI Not used: C:\Program Files\Arduino\hardware\arduino\avr\libraries\SPI Błąd kompilacji.


In contrast, the version 1.0.5 build with no errors and the program works. I'm not that good at C to independently find a solution. I'm using Arduino under Windows XP. Can anyone help?

Go back to 1.0.6.

grzecz:
In contrast, the version 1.0.5 build with no errors and the program works.
I’m not that good at C to independently find a solution. I’m using Arduino under Windows XP.
Can anyone help?

Did you try to include the SPI library in your main sketch?

#include <SPI.h> 
#include <SD.h>

Why do you update Arduino to a version just a few days old while not updating your Windows operating system for 10 years or so?

I never upgrade Windows.

The operating system was released to manufacturing on August 24, 2001, and generally released for retail sale on October 25, 2001.

Why do you update Arduino to a version just a few days old while not updating your Windows operating system for 10 years or so?

Good question! I love it.

Make that, like, 14 years.

To: Jurs, so I declared SPI.

Why Windows XP? Because that was just so at hand. 8)
Why most recent version of the Arduino? Because that was just under the cursor.

Why is a compilation error even examples from the library? I still do not know.
And this is the most painful. :o

Of course I used 1.0.5 for compilation.

Thank for help. :smiley:

Why is a compilation error even examples from the library? I still do not know.

They change stuff, that's why. The libraries don't keep up.