SD example file not working in 1.6.5

There seems to be an issue with the SD example sketch and the SDClass code. It will not compile.

Any one have a solution??

Any one have a solution??

Of course. Fix the compilation errors. If you need help, print the code and errors on soggy paper towels, using a blunt crayon, and take poorly lit, out of focus, 5 mega pixel pictures and post them here. Or something like that.

Paul, Thanks for the reply. Obviously I was not clear. The problem is with the Arduino provided SDClass. So their supplied SD example will not compile.

The same is true for all of the SD examples.

Error below::

In file included from ReadWrite.ino:22:0:
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h: In member function 'File SDClass::open(const String&, uint8_t)':
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h:74:87: error: 'const class String' has no member named 'c_str'
File open(const String &filename, uint8_t mode = FILE_READ) { return open( filename.c_str(), mode ); }
^
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h: In member function 'boolean SDClass::exists(const String&)':
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h:78:67: error: 'const class String' has no member named 'c_str'
boolean exists(const String &filepath) { return exists(filepath.c_str()); }
^
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h: In member function 'boolean SDClass::mkdir(const String&)':
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h:83:65: error: 'const class String' has no member named 'c_str'
boolean mkdir(const String &filepath) { return mkdir(filepath.c_str()); }
^
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h: In member function 'boolean SDClass::remove(const String&)':
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h:87:67: error: 'const class String' has no member named 'c_str'
boolean remove(const String &filepath) { return remove(filepath.c_str()); }
^
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h: In member function 'boolean SDClass::rmdir(const String&)':
C:\arduino-1.6.5-r5\libraries\SD\src/SD.h:90:65: error: 'const class String' has no member named 'c_str'
boolean rmdir(const String &filepath) { return rmdir(filepath.c_str()); }
^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

There seems to be an issue with the SD example sketch and the SDClass code. It will not compile.

I find that the SD read/write example compiles fine with 1.6.4, 1.6.5 and 1.6.6. I'm not sure which rev version of 1.6.5 I have, but it may be 1.6.5.0. I am using Windows 7 with 1.6.4 and 1.6.6 and
Windows 10 with 1.6.5.

Which board are you using? This looks like a problem with the String class not having member function c_str().

I am using 1.6.5r5 and the board is the new Simblee by RF Digital.

I am using 1.6.5r5 and the board is the new Simblee by RF Digital.

The problem is the RFduino String class. It is missing lots of code including this:

  const char * c_str() const { return buffer; }

RFduino still has the old version:

  const char *cstr() const { return buffer; }

I attached a diff of String from RFduino vs Arduino 1.6.5.

diff.txt (9.02 KB)

Thanks for the info. So do I add your diff file to the WString.cpp file in the Arduino 1.6.5 code or in the Simblee core section??

Thanks for the info. So do I add your diff file to the WString.cpp file in the Arduino 1.6.5 code or in the Simblee core section??

The whole core is 2-3 years out of date so you can't apply a simple patch.

You could add this to WString.h

  const char * c_str() const { return buffer; }