Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SD compilation error #2483

Closed
wants to merge 1 commit into from
Closed

Conversation

tomcombriat
Copy link
Contributor

@tomcombriat tomcombriat commented Sep 19, 2024

Trying to compile a simple sketch that includes the SD library for RP2040:

#include <SD.h>
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

leads to the error:

packages/rp2040/hardware/rp2040/4.0.2/libraries/SDFS/src/SDFS.h:287:31: error: 'using element_type = class File32' {aka 'class File32'} has no member named 'availableSpaceForWrite'; did you mean 'availableForWrite'?
  287 |         return _opened ? _fd->availableSpaceForWrite() : 0;
      |                               ^~~~~~~~~~~~~~~~~~~~~~
      |                               availableForWrite
Multiple libraries were found for "SD.h"
  Used: /home/tom/.arduino15/packages/rp2040/hardware/rp2040/4.0.2/libraries/SD
  Not used: /home/tom/.arduino15/libraries/SD
  Not used: /home/tom/Arduino_sketchbook/libraries/SD
Multiple libraries were found for "SdFat.h"
  Used: /home/tom/Arduino_sketchbook/libraries/SdFat_-_Adafruit_Fork
  Not used: /home/tom/.arduino15/packages/rp2040/hardware/rp2040/4.0.2/libraries/ESP8266SdFat

This PR fixes the error, but I have not tried yet if that is actually the correct fix.


I spotted this with a code that used to work does not compile anymore. Let me know if that is caused by a stupid mistake on my side (that has happened before…)

Copy link
Owner

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're trying to use SD.h or SDFS or SDFat from outside of the repo. They're not supported here and you need to run the included versions of those libraries.

Used: /home/tom/Arduino_sketchbook/libraries/SdFat_-_Adafruit_Fork

We build SD.h apps in CI for every pull and they are compiling properly.

@tomcombriat
Copy link
Contributor Author

tomcombriat commented Sep 19, 2024

My bad, indeed I was just compiling using your SdFat while I received your notification. Sorry for the wrong alert, a bit too "trigger happy" on this one…

Closing.

@tomcombriat tomcombriat deleted the fixSD branch September 19, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants