Error using SD card module: no matching function for call to This code is just a test code to write a file to an SD card using an SD card module. When I run the code, I get this error message and I'm not sure what to do to fix the code: no matching function for call to'SDLib::SDClass::exists(SDLib::File&amp;)'.

#include &lt;SD.h&gt;
#include &lt;SPI.h&gt;

int cs = 10; 

File myTest;  

void setup()
{
  //
  char myTestName[] = "MyTest.txt";  

  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {

  }
  Serial.println("Initializing SD card...");
  Serial.println();

  pinMode(cs, OUTPUT);
  pinMode(SS, OUTPUT);
  if (!SD.begin(cs)) {
    Serial.println("SD did not initiliaze");   
    while (1) ;
  }
  Serial.println("SD initialized.");

  if (! SD.exists(myTest)){
     myTest = SD.open(myTestName, FILE_WRITE); 

     myTest.println("My 1st Line of Data");
     myTest.flush(); 
  }
  else{
    myTest = SD.open(myTestName, FILE_WRITE); 
    myTest.println("Another Line of Data"); 
    myTest.flush();

  }

  Serial.println("Done Writing");

}

void loop()
{

}
The function is defined as

// Methods to determine if the requested file path exists.
boolean exists(char *filepath);


Source: https://github.com/adafruit/SD/blob/master/SD.h#L90

You call it with a File object, not the filename. You probably mixed up the variable names:

File myTest;  

void setup()
{
  //
  char myTestName[] = "MyTest.txt";  

  //[...]
  if (! SD.exists(myTest)){
     myTest = SD.open(myTestName, FILE_WRITE); 
     myTest.println("My 1st Line of Data");
     myTest.flush(); 
  }
//.. 


Just exchange myTest for myTestName in the SD.exists() call.