Old weather station still running but program won't now compile

I wanted to edit this weather station code which has been running for years, but the old unedited code won't verify, giving these errors. The error appears in line 138.

C:\Users\Norman\Documents\Arduino\Codes\BME280WeaStn05112022_copy_20260724181737_24-07-26\BME280WeaStn05112022_copy_20260724181737_24-07-26.ino: In function 'void setup()':
C:\Users\Norman\Documents\Arduino\Codes\BME280WeaStn05112022_copy_20260724181737_24-07-26\BME280WeaStn05112022_copy_20260724181737_24-07-26.ino:138:31: error: no matching function for call to 'SDLib::SDClass::begin(int, int, int, int)'
   if (!SD.begin(10, 11, 12, 13));
                               ^
In file included from C:\Users\Norman\Documents\Arduino\Codes\BME280WeaStn05112022_copy_20260724181737_24-07-26\BME280WeaStn05112022_copy_20260724181737_24-07-26.ino:6:0:
C:\Users\Norman\Documents\Arduino\libraries\SD\src/SD.h:71:12: note: candidate: bool SDLib::SDClass::begin(uint8_t)
       bool begin(uint8_t csPin = SD_CHIP_SELECT_PIN);
            ^~~~~
C:\Users\Norman\Documents\Arduino\libraries\SD\src/SD.h:71:12: note:   candidate expects 1 argument, 4 provided
C:\Users\Norman\Documents\Arduino\libraries\SD\src/SD.h:72:12: note: candidate: bool SDLib::SDClass::begin(uint32_t, uint8_t)
       bool begin(uint32_t clock, uint8_t csPin);
            ^~~~~
C:\Users\Norman\Documents\Arduino\libraries\SD\src/SD.h:72:12: note:   candidate expects 2 arguments, 4 provided
Multiple libraries were found for "Wire.h"
  Used: C:\Users\Norman\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.8\libraries\Wire
  Not used: C:\Users\Norman\Documents\Arduino\Libraries\Wire
Multiple libraries were found for "SD.h"
  Used: C:\Users\Norman\Documents\Arduino\Libraries\SD
  Not used: C:\Users\Norman\AppData\Local\Arduino15\libraries\SD
exit status 1

Compilation error: no matching function for call to 'SDLib::SDClass::begin(int, int, int, int) 

I would appreciate any help to correct this problem. Maybe I am getting too old for this stuff!
I am sorry if I have not entered the error list correctly and then the full code, because I do not understand how to do it properly. doesn't seem to work? Here is the code:-

#include <avr/wdt.h>

#include <SD.h>

#include <Wire.h>

#include <SPI.h>

#include <Adafruit_MCP23X17.h>

#include <Adafruit_Sensor.h>

#include <Adafruit_BME280.h>

#include <RTClib.h>

#include <Time.h>



#include <TimeAlarms.h>

#include <Adafruit_RGBLCDShield.h>

#include <PinChangeInt.h>

#define PIN 3  // the pin for button/ rain gauge

#define STOP_SWITCH 2



// Suspect these 3 lines became necessary with SD_Master update

// set up variables using the SD utility library functions:

Sd2Card card;

SdVolume volume;

SdFile root;



bool stopped = false;

RTC_DS1307 RTC;

time_t syncProvider()     //this does the same thing as RTC_DS1307::get() but it is only a definition.

//. Copied the next line from an Alarm example.

//setSyncProvider(syncProvider);     //reference our syncProvider function instead of RTC_DS1307::get()

//This tells the Time library to sync the Arduino time to the RTC.

{

  return RTC.now().unixtime();

}



uint32_t syncTime = 0; // time of last sync()



// for the data logging shield, we use digital pin 10 for the SD cs line

const int chipSelect = 10;



// the logging files

File logfile;

File rainfile;

void error(char \*str)

{

  Serial.print("error: ");

  Serial.println(str);

  while (1);

}

long mon = 0;

int dy = 0;

int hr = 0;

int mn = 0;

int sec = 0;

volatile int flag = 0;

int nflag;

int Run = 1;

int test = 1;

int nutim = 0;

int oldtim = 0;

int First = 0;

int Diff = 0;

char Dirn = 'N';

int prX = 1000;

int prN = 1000;

int pr2X = 1000;

int pr2N = 1000;

Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();

Adafruit_BME280 bme;

float temp;

float maxT;

float minT = 90;

float maxTy;

float minTy;

float rh = 0;

float rhX = 0;

float rhXY = 0;

float rhN = 90;

float rhNY = 90;

float pr = 0;

float prr = 1000;

byte \_status;

long zerosec = millis();

unsigned long delayTime;



void setup()

{

  Serial.begin(9600);

  bool status;

  status = bme.begin();

  if (!status) {

    Serial.println("Could not find a valid BME280 sensor, check wiring!");

    while (1);

  }



 /\* Serial.println("-- Sensor Test --");

  delayTime = 1000;

  Serial.println();

  delay(100); // let sensor boot up

  Serial.print("Temperature = ");

  temp = (bme.readTemperature());

  Serial.print(temp, 2);

  Serial.println(" \*C");

  Serial.print("Pressure = ");

  pr = bme.readPressure();

  Serial.print(pr, 2);

  Serial.println(" hPa");

  Serial.print("Humidity = ");

  rh = bme.readHumidity();

  Serial.print(rh);

  Serial.println(" %");

  Serial.println();



  \*/// set up the LCD's number of columns and rows:

  lcd.begin(16, 2);

  Wire.begin();

  RTC.begin();

  if (! RTC.isrunning()) {

    // following line sets the RTC to the date & time this sketch was compiled so if it is used other than

    //on load time, the RTC time will be set back to whatever time and date compilation occured.

    // this can be improved by issuing warning if RTC time is behind arduino time using an If.

    RTC.adjust(DateTime(\__DATE_\_, \__TIME_\_));

  }

  //RTC.adjust(DateTime(\__DATE_\_, \__TIME_\_)); //Comment this once local time has been set.

  setSyncProvider(syncProvider);     //reference our syncProvider function instead of RTC_DS1307::get()



  //configure pin2 as an input and enable the internal pull-up resistor

  pinMode(STOP_SWITCH, INPUT_PULLUP);



  // initialize the SD card

  Serial.print("InitSD");

  // make sure that the default chip select pin is set to

  // output, even if you don't use it:

  pinMode(53, OUTPUT);  //53 required for Mega



  // see if the card is present and can be initialized:

  if (!SD.begin(10, 11, 12, 13));

  {

    error("Cd fail");

  }

  Serial.println("cdinit.");

  // create a new file

  char filename\[\] = "LOGGER00.CSV";

  for (uint8_t i = 0; i < 100; i++)

  {

    filename\[6\] = i / 10 + '0';

    filename\[7\] = i % 10 + '0';

    if (! SD.exists(filename)) {

      // only open a new file if it doesn't exist

      logfile = SD.open(filename, FILE_WRITE);

      break;  // leave the loop!

    }

  }



  if (! logfile) {

    error("No lgfile");

  }



  Serial.print("Log to ");

  Serial.println(filename);

  Serial.println();



  // create a new file

  char filename2\[\] = "RAINEY00.CSV";

  for (uint8_t i = 0; i < 100; i++)

  {

    filename2\[6\] = i / 10 + '0';

    filename2\[7\] = i % 10 + '0';

    if (! SD.exists(filename2)) {

      // only open a new file if it doesn't exist

      rainfile = SD.open(filename2, FILE_WRITE);

      break;  // leave the loop!

    }

  }

  //This should work but does not - why?

  /\*  if (! rainfile) {

    error("couldnt create rnfile");

    }

   \*/

  Serial.print("Log to ");

  Serial.println(filename2);

  Serial.println();

  

  /\* DateTime now = RTC.now();  // to  test that the time is correct.

    mon = now.month();

    dy = now.day();

    hr = now.hour();

    mn = now.minute();

    Serial.print(mon);

    Serial.print(";");

    Serial.print(hr);

    Serial.print(':');

    Serial.print(mn);

\*/

  pinMode(PIN, INPUT);     //set the pin to input

  digitalWrite(PIN, LOW);  //1 Megohm physical to -ve

  attachInterrupt(digitalPinToInterrupt(3), burpcount, RISING);

  // attach an Interrupt to our pin for the rising edge.

  // and execute the function burpcount when that pin changes.



  /\*Information on :- attachInterrupt(digitalPinToInterrupt(pin), ISR, mode);



  interrupt:  the number of the interrupt (int)

  pin:    the pin number  (Arduino Due, Zero, MKR1000 only)

  ISR:    the ISR to call when the interrupt occurs; this function must take no parameters and return

      nothing. This function is sometimes referred to as an interrupt service routine.

  mode:     defines when the interrupt should be triggered. Four constants are predefined as valid values:



          LOW to trigger the interrupt whenever the pin is low,

          CHANGE to trigger the interrupt whenever the pin changes value

          RISING to trigger when the pin goes from low to high,

          FALLING for when the pin goes from high to low.

   \*/ // and execute the function burpcount when that pin changes.



  //2 line to kick off imediately.

  //Repeat3(); //Loggs Midnight max & Min and Monthly heading on 1st.

  Repeats(); //Main half-hourly logging of Temp, RH & Pressure.    This calls Time now for testing

  Repeat2(); // 8 second update display on LCD - 3 separete pages.  This calls Time now for testing

  Alarm.timerRepeat(8, Repeat2);  // LCD display, 8 seconds.

  Alarm.alarmRepeat(0, 1, 0, Repeat3); // One minute past Midnight date and Max/Min.

  while (minute() != 0) //Prog holds here until the hour so that logging is on the hour and the half hour.

  {

    delay(1000);

  }

 

  Serial.print(" setup minute ");

  Serial.println(minute(), DEC);

  Alarm.timerRepeat(1800, Repeats); //Main half-hourly logging of Temp, RH & Pressure. All Alarms run outside the loop.

 

  wdt_enable(WDTO_8S);  // Watch Dog timer set to 8 seconds.

}



void loop()

{

  if (LOW == digitalRead(STOP_SWITCH)) {

    logfile.flush();

    rainfile.flush();

    Serial.println("flush");

    delay(10); //switch debounce interval



    while (LOW == digitalRead(STOP_SWITCH)) {  //stick here until stop switch is turned off.

      stopped = true;

      wdt_reset();  // prevents a sketch restart while stop switch is in use.

    }

  }

      stopped = false;  //stop switch currently turned off



  Alarm.delay(0); // wait 0 seconds - something needed here or alarm does not work



  if (flag != nflag) {

    DateTime now = RTC.now();

    mon = now.month();

    dy = now.day();

    hr = now.hour();

    mn = now.minute();

    sec = now.second();

    nutim = mn;

    if ((nutim - oldtim) >= 2) {

      test = 1;

    }

    oldtim = mn;

    rainfile.print(flag \*0.0863);

    rainfile.print(";");

    rainfile.print(dy);

    rainfile.print("/");

    rainfile.print(mon);

    rainfile.print(";");

    rainfile.print(hr);

    rainfile.print(':');

    rainfile.print(mn);

    rainfile.print(':');

    rainfile.print(sec);

    rainfile.println();



    if (test == 1) {

      rainfile.flush();

      Serial.println(F("flushed"));

    }

    test = 0;

  }

  nflag = flag;

  wdt_reset();

}



void Repeats() {  //  Every 30 minutes.

 DateTime now = RTC.now();

  logfile.print(now.day(), DEC);

  logfile.print("/");

  logfile.print(now.month(), DEC);

  logfile.print("/");

  logfile.print(now.year(), DEC);

  logfile.print(",");

  logfile.print(now.hour(), DEC);

  Serial.print(now.hour(), DEC);

  logfile.print(":");

  logfile.print(now.minute(), DEC);

  Serial.println(now.minute(), DEC);

  logfile.print(", ");

  logfile.print(" RH ");

  logfile.print(rh);

  logfile.print(",");

  logfile.print("T ");

  logfile.print(temp);

  logfile.print(",");

  logfile.print("P ");

  Serial.print("P ");

  logfile.print(pr, 1);

  Serial.println(pr, 1);

  //logfile.print(";");

  logfile.println();

  logfile.flush();

}



void Repeat2() {

  //LCD pressure, rain,Temp & Line 2 humidity.

  rh = (bme.readHumidity());

  pr = (bme.readPressure());

  temp = (bme.readTemperature());



  maxT = max(temp, maxT); // these Max & Mins work for all readings of temp, until reset after midnight.

  minT = min(temp, minT);



  rhX = max(rh, rhX);

  rhN = min(rh, rhN);

  pr = pr / 100;

  pr = round (pr);

 /\* Serial.print(F("Rpt2 minute "));

  Serial.println(minute());

  Serial.print("prr = ");

  Serial.println(prr );

 \*/ if (minute() == 0) {

    prr = pr;

    pr2X = pr;

    pr2N = pr;

  }

  // prr is 7 or 8 readings of Pressure taken during minute 0, top of the hour.

  

  pr2X = max(pr, pr2X);     // These two lines collect the max & Min of 60 minute readings.

  pr2N = min(pr, pr2N);

  

  prX = max(pr, prX);       // These two lines collect the max & Min of 24h readings.

  prN = min(pr, prN);



  if (pr2X > (prr + 1)) {   // this block compares the hour reading with the max or min during the hour every 8 seconds

    Diff = (pr2X - prr);

    Dirn = 'D';

  }

  else if (pr2N < (prr - 1)) {

    Diff = (prr - pr2N);

    Dirn = 'U';

  }

  else {

    Diff = 0;

    Dirn = '=';

  }

  

  switch (Run) {

    case 1:

      lcd.setCursor(0, 0);

      lcd.print(F("                "));

      lcd.setCursor(0, 0);

      lcd.print(F("P"));

      lcd.print(pr, 0);

      lcd.print(" ");

      lcd.print(Dirn);

      lcd.print(Diff);  //Change since last hour point.Ex 16 characters: P1009 U99 Rn9999

      //lcd.setCursor(10, 0);

      lcd.print(F(" Rn"));

      lcd.print(flag \*0.0863);

      lcd.setCursor(0, 1); // 2nd row

      lcd.print(F("Temp"));  //Ex 16 char Temp29.1 RH 88.1

      lcd.print(temp, 1);

      lcd.print(F(" RH "));

      lcd.println(rh, 1);

      Run ++ ;

      break;



    case 2:

      lcd.setCursor(0, 0);// LCD Max & Min temp and Yesterdays Max and Min temp line 2

      lcd.print(F("                ")); // Wipes line clean, otherwise previous data remains.

      lcd.setCursor(0, 0);

      lcd.print(F("Max"));  //Ex 16 characters Max33.5 Min17.5

      lcd.print(maxT, 1);

      lcd.print(F(" "));

      lcd.print(F("Min"));

      lcd.print(minT, 1);

      lcd.setCursor(0, 1);

      lcd.print(F("                "));

      lcd.setCursor(0, 1);

      lcd.print(F("Yx "));  //16 characters Yx 15.5 Yn 13.2

      lcd.print(maxTy, 1);

      lcd.print(F(" Yn "));

      lcd.print(minTy, 1);

      Run = 1;  //cuts out case 3 Rh max and mins.

      break;



    /\* case 3:

      lcd.setCursor(0, 0);// LCD max and Min RH and Yesterdays Max & Min RH line 2.

      lcd.print(F("                ")); // Wipes line clean, otherwise previous data remains.

      lcd.setCursor(0, 0);

      lcd.print(F("RHX"));  // 16 characters RHX60.1 RHN 45.3

      lcd.print(rhX, 1);  //  RH Max

      lcd.print(F(" "));

      lcd.print(F("RHN "));

      lcd.print(rhN, 1);  //  RH Min

      lcd.setCursor(0, 1);

      lcd.print(F("                "));

      lcd.setCursor(0, 1);

      lcd.print(F("RMY"));  // Ex 16 characters RMY88.9 RNY 44.5

      lcd.print(rhXY, 1);  // Yesterday RH Max

      lcd.print(F(" RNY "));

      lcd.print(rhNY, 1);  // Yesterday RH Min

      Run = 1;

      break; \*/

  }

}

void Repeat3() {

  DateTime now = RTC.now();

  if (now.day() == 1 && now.month() == 1) {

    logfile.println(now.year());

    logfile.print(",");

    logfile.println(F("January"));

  }

  if (now.day() == 1 && now.month() == 2)

    logfile.print(F("February"));



  if (now.day() == 1 && now.month() == 3)

    logfile.print(F("March"));



  if (now.day() == 1 && now.month() == 4)

    logfile.print(F("April"));



  if (now.day() == 1 && now.month() == 5)

    logfile.print(F("May"));



  if (now.day() == 1 && now.month() == 6)

    logfile.print(F("June"));



  if (now.day() == 1 && now.month() == 7)

    logfile.print(F("July"));



  if (now.day() == 1 && now.month() == 8)

    logfile.print(F("August"));



  if (now.day() == 1 && now.month() == 9)

    logfile.print(F("September"));



  if (now.day() == 1 && now.month() == 10)

    logfile.print(F("October"));



  if (now.day() == 1 && now.month() == 11)

    logfile.print(F("November"));



  if (now.day() == 1 && now.month() == 12)

    logfile.print(F("December"));

  logfile.print(";");

  logfile.print(";");

  logfile.print(";");

  logfile.print(";");

  logfile.print(";");

  logfile.print(";");

  logfile.print(";");

  logfile.print("TMax ");

  logfile.print(maxT, 2);

  logfile.print(" TMin ");

  logfile.print(minT, 2);

  logfile.print(" RH Max ");

  logfile.print(rhX, 2); 

  logfile.print(" RH Min ");

  logfile.print(rhN, 2);

  logfile.println();

  logfile.flush();

  maxTy = maxT;

  minTy = minT;

  maxT = 0;

  minT = 99;

  rhXY = rhX;

  rhNY = rhN;

  rhX = 0;

  rhN = 90;

  

}



void burpcount() //Counts rain gauge tipper pulses.

{

  flag++;

}

Please edit your post, select the text of the whole sketch then click on the < CODE > icon to add code tags and then save the post

Better still, use Tools/Auto Format in the IDE and post the sketch in code tags

@spiney actually had the code tags but the first part got garbled as the tags were not in their own line by themselves. I fixed it.

The error comes from the version of the SD library currently installed, which no longer accepts the four-argument syntax SD.begin(10, 11, 12, 13). In recent versions of SD.h you would typically use the overload SD.begin(uint8_t csPin) so only the CS pin should be passed.

That line also has an unrelated bug:

the semicolon right after the closing parenthesis makes the if statement empty, so error("Cd fail") runs unconditionally regardless of whether the SD card actually initialized.

The fix, using the chipSelect constant already defined earlier in the code, is:

if (!SD.begin(chipSelect)) error("Cd fail");

Note also that the log shows two versions of Wire and two versions of SD being found on the system, one from the AVR core and one manually installed in the Libraries folder. That's not causing this particular failure, but mismatched versions between the two can cause weird behavior later.

It uses the old Adafruit SD library. You need to install it.

It is always a confusion to me as:
Do we include the library in the sketch?

or

Do we install the library? If installing, then shouldn't it be installed in PC? But, a library is a file and NOT an application.

You include the library, but if it isn't present in any of the library folders, it should be 'installed' into one.

Installing is done through the library manager. Installing in this case is not much more than copying the files from a remote repository into the sketchbook libraries folder.

Many libraries that are used are included in a specific board (group) core and don't require 'installation' and since 'installing' a library is no more than a copying of files, it can also be done manually (If the library is not available in the library manager that is the way anyway)
How a choice for libraries is made is always a bit of a mystery

Multiple libraries were found for "Wire.h"
  Used: C:\Users\Norman\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.8\libraries\Wire
  Not used: C:\Users\Norman\Documents\Arduino\Libraries\Wire

here a file from the AVR core is used.

Used: C:\Users\Norman\Documents\Arduino\Libraries\SD
  Not used: C:\Users\Norman\AppData\Local\Arduino15\libraries\SD

Here a file from the sketchbook folder is used (instead of a generic version)

There is also the option of copying the files required straight into the sketch folder, which will be the first choice for the compiler.
Any .cpp files found in the same folder as the included header file, will also be compiled.

In you case the confusion seems to stem from the use of the word 'install' and you are correct, nothing is really being installed, but installing is used for a lack of a better word i guess.

This is completely off topic and has nothing to do with solving @spiney problem.

DO NOT hijack posts for your own purposes.

@spiney please see post #5 for a solution.

or post 4 if you want to use the "modern" SD library.

In this case does installing an older version requires the removal of the latest installed version ?

Personally i am not against seeking some extra clarification on that matter.

if @GolamMostafa is confused a little about that, it may also go for the OP.

How to tell which library actually gets used seem like related to the topic since the original issue is caused by differing versions of SD library.

When you have 2 or more libraries that both provide the same header file, like SD.h, Arduino IDE prints info about the conflicting libraries and tell you which one it actually used and the other(s) it ignored. If you select verbose compile output in File > Preferences (or Arduino IDE > Settings on MacOS), this info is always printed. Without verbose, it's only printed if an error prevents successful compile. You can either turn on verbose, or just add a simple syntax error and click Verify. The info gets printed to the console panel which is usually short, so you may need to resize the window or scroll up to see the libraries used info.

Hopefully that libraries used info can help you to know whether Arduino IDE used the library you intended. If it used one you didn't want, then you'll probably need to uninstall or delete or move the files so Arduino IDE doesn't see it.

Replying to an of topic post is also off topic. Please don't continue with off topic questions.

Thank you everyone for the replies. Firstly the unwanted semicolon was my fault and did not appear in the original working code; I saw that there was no semicolon and thought there should have been one - I was wrong gto say "unedited"
So I have downloaded the Github zipped code, but I don't know how and where to put it. Sadly it is so long ago that I did this project that I have forgotten what I suppose I once did. Is the problem that the old Adafruit library has automatically updated and I need to put the old one back in my library, leaving both there?

If you have issues, you can take it up with the moderator, which is a task you yourself are clearly not suitable for. If you enable your personal messages and/or are willing to communicate in a decent matter i am open to doing so. Please keep your authoritarian attitude focussed on things that you are more than qualified for, like actual solutions and part suggestions.

@Deva_Rishi and @jim-p
No more of this please

Put the zip folder anywhere you can later find it.
In the IDE click on Sketch->Include Library->Add ZIP Library. Then find your zip and select it

Thank you Jim-P. Done that. (and got rid of the semi colon.) I get what looks like the same fault message with Not used SD-Master as well as SD. In the library list is now both SD and SD-Master. Should I delete SD?

C:\Users\Norman\Documents\Arduino\Codes\BME280WeaStn05112022_copy_20260724181737_24-07-26\BME280WeaStn05112022_copy_20260724181737_24-07-26.ino: In function 'void setup()':
C:\Users\Norman\Documents\Arduino\Codes\BME280WeaStn05112022_copy_20260724181737_24-07-26\BME280WeaStn05112022_copy_20260724181737_24-07-26.ino:138:31: error: no matching function for call to 'SDLib::SDClass::begin(int, int, int, int)'
   if (!SD.begin(10, 11, 12, 13))
                               ^
In file included from C:\Users\Norman\Documents\Arduino\Codes\BME280WeaStn05112022_copy_20260724181737_24-07-26\BME280WeaStn05112022_copy_20260724181737_24-07-26.ino:6:0:
C:\Users\Norman\Documents\Arduino\libraries\SD\src/SD.h:71:12: note: candidate: bool SDLib::SDClass::begin(uint8_t)
       bool begin(uint8_t csPin = SD_CHIP_SELECT_PIN);
            ^~~~~
C:\Users\Norman\Documents\Arduino\libraries\SD\src/SD.h:71:12: note:   candidate expects 1 argument, 4 provided
C:\Users\Norman\Documents\Arduino\libraries\SD\src/SD.h:72:12: note: candidate: bool SDLib::SDClass::begin(uint32_t, uint8_t)
       bool begin(uint32_t clock, uint8_t csPin);
            ^~~~~
C:\Users\Norman\Documents\Arduino\libraries\SD\src/SD.h:72:12: note:   candidate expects 2 arguments, 4 provided
Multiple libraries were found for "SD.h"
  Used: C:\Users\Norman\Documents\Arduino\Libraries\SD
  Not used: C:\Users\Norman\AppData\Local\Arduino15\libraries\SD
  Not used: C:\Users\Norman\Documents\Arduino\Libraries\SD-master
Multiple libraries were found for "Wire.h"
  Used: C:\Users\Norman\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.8\libraries\Wire
  Not used: C:\Users\Norman\Documents\Arduino\Libraries\Wire
exit status 1

Compilation error: no matching function for call to 'SDLib::SDClass::begin(int, int, int, int)'

if you look closely, the compiler says :

so it's using the built in, default SD library. Try what I suggested in post 4...

if (!SD.begin(chipSelect)) error("Cd fail");

Try closing and opening the IDE or you can try what @J-M-L suggested.