-1

is there any way to rename a file in sd card without using SdFat? Thank you im getting error when inclung the

    #include <SPI.h>
    //#include <SD.h>
    #include <SdFat.h>
    extern SdFat SD;

the error msg was "Error compiling for board Arduino/Genuino Uno. "

Local\Temp\ccZn9IeW.ltrans2.ltrans.o: In function FatVolume::init(unsigned char) [clone .constprop.18]': \Arduino\libraries\SdFat\src/FatLib/FatVolume.cpp:439: undefined reference to SD' \Arduino\libraries\SdFat\src/FatLib/FatVolume.cpp:440: undefined reference to `SD'
  • Looks like you did not add this library the correct way. Please give more information: your IDE, your board, your settings and folder structure of your SdFat library. – Faig Sep 17 '18 at 14:15
  • The standard arduino sd library can not rename a file. The sdfat library can rename a file. If you want to rename a file, then you have to use the sdfat library. – Jot Sep 17 '18 at 14:17
1

Remove the extern keyword from SdFat SD; because it tels the compiler that the variable is defined elsewhere and it is not and the linker then can't find it.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.