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

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
spiney
 
Posts: 214
Joined: Mon Jul 09, 2012 6:35 am

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

Post by spiney »

I have been running a weather station program on an Arduino Mega. It was running on IDE version 1.5.6-r2.
I had to make a calibration adjustment and stupidly accepted an IDE update. I got two compilation errors, fixed the first by adding TimeLib.h. The second error gives:-
Compilation error: no matching function for call to 'SDClass::begin(int, int, int, int)'
This worked before. #include <SD.h> is present.
I can't remember when I had to add an SD_Master update, but I added these lines after the includes: I don't understand them. (My 81 year old memory defective!)
// 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;
Do I need another SD library update please?

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: no matching function for call to 'SDClass::begin(int, int, int, int)'

Post by dastels »

The first step is to make sure that Arduino and any board support packages and libraries are completely up to date.

Dave

User avatar
spiney
 
Posts: 214
Joined: Mon Jul 09, 2012 6:35 am

Re: no matching function for call to 'SDClass::begin(int, int, int, int)'

Post by spiney »

Thank you Dave. I don't know how to find out if all the libraries are up to date, and in any case updating them may cause more problems, which is what happened when I accepted a new Arduino IDE version update.
I have run up an old laptop and found the old IDE still installed. I refused the immediate Arduino IDE update offer and my program compiles happily on the old IDE. So my problem is solved, so long as the old laptop lives.
I belive it is not possible to download out of date IDE versions.
I think I shall see if the Arduino download still exists in the old laptop and copy it across if it does.

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: no matching function for call to 'SDClass::begin(int, int, int, int)'

Post by dastels »

I think it's more an issue of mismatched library/board versions. Updating Arduino would update the core libraries. If you have old versions of other libraries, you will likely have problems. It's best to keep everything up to date. That's the biggest cause of problems I've seen.

Look in "Sketch->Include Library->Manage Libraries" and pick "Updatable" in the type dropdown. Then click Update on each one. Always install "all dependencies" when asked.

Then in "Tools->Board->Boards Manager". Do the same, setting type to updatable and updating all in the list.

Dave

User avatar
spiney
 
Posts: 214
Joined: Mon Jul 09, 2012 6:35 am

Re: no matching function for call to 'SDClass::begin(int, int, int, int)'

Post by spiney »

Thank you Dastels,
I have just allowed it to update all libraries and the boards too, though I have not installed the board update.
The program still will not compile with the same error.
I shall try to re-install the old SD Master library from the old laptop. I suppose I should erase the new SD library first?

User avatar
spiney
 
Posts: 214
Joined: Mon Jul 09, 2012 6:35 am

Re: no matching function for call to 'SDClass::begin(int, int, int, int)'

Post by spiney »

I have a whole lot of trouble now. Multiple libraries are reported in the error messages and the final error is with the same Begin error.
Here is the whole list of errors.
I think that I should give up and stop wasting your time, for which I have been very grateful.
While my old Laptop continues to work I am able to address the Arduino Mega weather station, using the ancient IDE and the libraries loaded on that machine.

In file included from L:\Arduino\Codes\BME280WeaStn051122\BME280WeaStn051122.ino:15:0:
C:\Users\User\Documents\Arduino\libraries\Adafruit_BME280_Library/Adafruit_BME280.h:116:8: error: conflicting return type specified for 'virtual bool Adafruit_BME280_Temp::getEvent(sensors_event_t*)'
bool getEvent(sensors_event_t *);
^~~~~~~~
In file included from L:\Arduino\Codes\BME280WeaStn051122\BME280WeaStn051122.ino:14:0:
C:\Users\User\Documents\Arduino\libraries\Adafruit_Sensor_master/Adafruit_Sensor.h:146:16: error: overriding 'virtual void Adafruit_Sensor::getEvent(sensors_event_t*)'
virtual void getEvent(sensors_event_t*);
^~~~~~~~
In file included from L:\Arduino\Codes\BME280WeaStn051122\BME280WeaStn051122.ino:15:0:
C:\Users\User\Documents\Arduino\libraries\Adafruit_BME280_Library/Adafruit_BME280.h:130:8: error: conflicting return type specified for 'virtual bool Adafruit_BME280_Pressure::getEvent(sensors_event_t*)'
bool getEvent(sensors_event_t *);
^~~~~~~~
In file included from L:\Arduino\Codes\BME280WeaStn051122\BME280WeaStn051122.ino:14:0:
C:\Users\User\Documents\Arduino\libraries\Adafruit_Sensor_master/Adafruit_Sensor.h:146:16: error: overriding 'virtual void Adafruit_Sensor::getEvent(sensors_event_t*)'
virtual void getEvent(sensors_event_t*);
^~~~~~~~
In file included from L:\Arduino\Codes\BME280WeaStn051122\BME280WeaStn051122.ino:15:0:
C:\Users\User\Documents\Arduino\libraries\Adafruit_BME280_Library/Adafruit_BME280.h:144:8: error: conflicting return type specified for 'virtual bool Adafruit_BME280_Humidity::getEvent(sensors_event_t*)'
bool getEvent(sensors_event_t *);
^~~~~~~~
In file included from L:\Arduino\Codes\BME280WeaStn051122\BME280WeaStn051122.ino:14:0:
C:\Users\User\Documents\Arduino\libraries\Adafruit_Sensor_master/Adafruit_Sensor.h:146:16: error: overriding 'virtual void Adafruit_Sensor::getEvent(sensors_event_t*)'
virtual void getEvent(sensors_event_t*);
^~~~~~~~
L:\Arduino\Codes\BME280WeaStn051122\BME280WeaStn051122.ino: In function 'void setup()':
L:\Arduino\Codes\BME280WeaStn051122\BME280WeaStn051122.ino:142: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 L:\Arduino\Codes\BME280WeaStn051122\BME280WeaStn051122.ino:10:0:
C:\Users\User\AppData\Local\Arduino15\libraries\SD\src/SD.h:71:15: note: candidate: boolean SDLib::SDClass::begin(uint8_t)
boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN);
^~~~~
C:\Users\User\AppData\Local\Arduino15\libraries\SD\src/SD.h:71:15: note: candidate expects 1 argument, 4 provided
C:\Users\User\AppData\Local\Arduino15\libraries\SD\src/SD.h:72:15: note: candidate: boolean SDLib::SDClass::begin(uint32_t, uint8_t)
boolean begin(uint32_t clock, uint8_t csPin);
^~~~~
C:\Users\User\AppData\Local\Arduino15\libraries\SD\src/SD.h:72:15: note: candidate expects 2 arguments, 4 provided
Multiple libraries were found for "SD.h"
Used: C:\Users\User\AppData\Local\Arduino15\libraries\SD
Not used: C:\Users\User\Documents\Arduino\libraries\SD-master
Multiple libraries were found for "SPI.h"
Used: C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI
Not used: C:\Users\User\Documents\Arduino\libraries\SPI
Multiple libraries were found for "Adafruit_MCP23017.h"
Used: C:\Users\User\Documents\Arduino\libraries\Adafruit_MCP23017_Arduino_Library_master
Not used: C:\Users\User\Documents\Arduino\libraries\Adafruit_RGB_LCD_Shield_Library_master
Multiple libraries were found for "Wire.h"
Used: C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire
Not used: C:\Users\User\Documents\Arduino\libraries\Wire
exit status 1

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

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: no matching function for call to 'SDClass::begin(int, int, int, int)'

Post by dastels »

Those errors look like library version mismatches. Libraries have features added, and bugs fixed continuously. Various libraries are related and dependant on others. So having the latest version of all the libraries is pretty much required.

You can stick with the outdated installation if that works, but I advise getting everything updated and working.

Dave

User avatar
spiney
 
Posts: 214
Joined: Mon Jul 09, 2012 6:35 am

Re: no matching function for call to 'SDClass::begin(int, int, int, int)'

Post by spiney »

Thank you Dave,
I have already followed your advice and asked for all libraries to be updated, and indeed that did happen. I asked also that the board be updated. None of that allowed the program to be compiled. There were more than one copy of some libraries and that does not seem a good idea to me, but if it were possible to delete one, which one should be chosen; version dates are not visible to me.
I did not, and I won't, install the board changes in case that spoils the use of the old system with this weather station. (But that should be irrelevant for compilation.)
If I have need to use another Arduino, that would be the time to update the new board for a totally separate project.
It would be nice to know how to clear out all the libraries and the IDE, so that I could make a clean start, but I don't know where the libraries reside and have not found a way to delete them.
Regards,
Norman

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: no matching function for call to 'SDClass::begin(int, int, int, int)'

Post by dastels »

There should be arduino related directories in your home directory. Look around in them for a "libraries" directory.

Yes, multiply versions of a library will confuse the build process.

Board support packages generally don't change as much as libraries, so you're more ok leaving those.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”