SDinfo compile error - no matching function for call to 'Sd2Card.....

I am using an Arduino Leonardo and setting it up with the Adafruit datalogger shield. the RTC works fine, but I am having problems with the SD Card. I have downloaded the modified SD library as per the Adafruit tutorial and have then loaded the sdinfo code from the examples folder. This compiles ok until I change the line

  if (!card.init(SPI_HALF_SPEED, chipSelect)) {

to
  if (!card.init(SPI_HALF_SPEED, 10, 11, 12, 13)) { and then I get the error:-

C:\Users\John\AppData\Local\Temp\arduino_75f63a30c0528e7740a709c27919fb7b\CardInfo.ino: In function 'void setup()':

CardInfo:49: error: no matching function for call to 'Sd2Card::init(const uint8_t&, int, int, int, int)'

   if (!card.init(SPI_HALF_SPEED, 10, 11, 12, 13)) {

                                                ^

C:\Users\John\AppData\Local\Temp\arduino_75f63a30c0528e7740a709c27919fb7b\CardInfo.ino:49:48: note: candidates are:

In file included from M:\Documents\Arduino\libraries\SDbackup\src/utility/SdFat.h:29:0,

                 from M:\Documents\Arduino\libraries\SDbackup\src/SD.h:20,

                 from C:\Users\John\AppData\Local\Temp\arduino_75f63a30c0528e7740a709c27919fb7b\CardInfo.ino:24:

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:176:11: note: uint8_t Sd2Card::init()

   uint8_t init(void) {

           ^

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:176:11: note:   candidate expects 0 arguments, 5 provided

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:184:11: note: uint8_t Sd2Card::init(uint8_t)

   uint8_t init(uint8_t sckRateID) {

           ^

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:184:11: note:   candidate expects 1 argument, 5 provided

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:187:11: note: uint8_t Sd2Card::init(uint8_t, uint8_t)

   uint8_t init(uint8_t sckRateID, uint8_t chipSelectPin);

           ^

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:187:11: note:   candidate expects 2 arguments, 5 provided

exit status 1
no matching function for call to 'Sd2Card::init(const uint8_t&, int, int, int, int)'

This is my first real Arduino project and I would really appreciate any help.

It would appear that function is only expecting the chip select pin as an argument. 11, 12, and 13 are the normal SPI pins and I'm sure the code for that function already knows where they are.

The Arduino instructions say you have to add the pin designations when using the Leonardo or Mega. I assume that is also why you have to use the updated SD library

wheelyjohn:
The Arduino instructions say you have to add the pin designations when using the Leonardo or Mega. I assume that is also why you have to use the updated SD library

I don't have that or any link to it so I can't tell you.

Adafruit instructions are here:-

Well you must not have copied their library right then because your error messages say you have a version for 0 arguments, a version for 1 argument, and a version that takes 2 arguments. But there's no version of init that takes 5 arguments. At least that's what the compiler is telling you in the error messages.

It's silly of them to think you need a different SD library because the Mega has different SPI pins from the Uno. They're all defined in io.h by their names for just that reason. I don't know how many thousands of people have used an SD card on the Mega with the normal library and it worked. I don't understand why they're saying it wouldn't.

I tried SDinfo with the original SD library and I get the following:-

Initializing SD card...initialization failed. Things to check:

  • is a card inserted?
  • is your wiring correct?
  • did you change the chipSelect pin to match your shield or module?

I used chipSelect set to 10 which is I understand correct for the Adafruit datalogger shield, I am using it with an Arduino Leonardo

I had a look at the library I downloaded and it has the following lines, so it looks as if the correct library has been downloaded?

  /*

    Performs the initialisation required by the sdfatlib library.

    Return true if initialization succeeds, false otherwise.

   */
  return card.init(SPI_HALF_SPEED, csPin, mosi, miso, sck) &&
         volume.init(card) &&
         root.openRoot(volume);
}

My libraries seem to exist in 2 places Documents\Arduino\libraries, and Program Files (x86)\Arduino\libraries.
I have put the downloaded SD library in both locations, but why are there 2 of them?
I am still getting the following errors when I compile.

M:\Documents\Arduino\SD_CARD_TEST\SD_CARD_TEST.ino: In function 'void setup()':

SD_CARD_TEST:49: error: no matching function for call to 'Sd2Card::init(const uint8_t&, int, int, int, int)'

   if (!card.init(SPI_HALF_SPEED, 10, 11, 12, 13)) {

                                                ^

M:\Documents\Arduino\SD_CARD_TEST\SD_CARD_TEST.ino:49:48: note: candidates are:

In file included from M:\Documents\Arduino\libraries\SDbackup\src/utility/SdFat.h:29:0,

                 from M:\Documents\Arduino\libraries\SDbackup\src/SD.h:20,

                 from M:\Documents\Arduino\SD_CARD_TEST\SD_CARD_TEST.ino:24:

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:176:11: note: uint8_t Sd2Card::init()

   uint8_t init(void) {

           ^

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:176:11: note:   candidate expects 0 arguments, 5 provided

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:184:11: note: uint8_t Sd2Card::init(uint8_t)

   uint8_t init(uint8_t sckRateID) {

           ^

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:184:11: note:   candidate expects 1 argument, 5 provided

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:187:11: note: uint8_t Sd2Card::init(uint8_t, uint8_t)

   uint8_t init(uint8_t sckRateID, uint8_t chipSelectPin);

           ^

M:\Documents\Arduino\libraries\SDbackup\src/utility/Sd2Card.h:187:11: note:   candidate expects 2 arguments, 5 provided

exit status 1
no matching function for call to 'Sd2Card::init(const uint8_t&, int, int, int, int)'

Any further help would be much appreciated, I have hit a brick wall at the moment