Anyone have any ideas on why this code fails to compile. I cant tell if its my install or the code...
Errors:
In file included from /Users/November/Documents/Arduino/libraries/SdFat/SdFile.h:24,
from /Users/November/Documents/Arduino/libraries/SdFat/SdFat.h:35,
from sketch_dec12a.ino:2:
/Users/November/Documents/Arduino/libraries/SdFat/SdBaseFile.h:36: error: using typedef-name 'fpos_t' after 'struct'
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/stdio.h:59: error: 'fpos_t' has a previous declaration here
In file included from /Users/November/Documents/Arduino/libraries/SdFat/iostream.h:26,
from /Users/November/Documents/Arduino/libraries/SdFat/SdStream.h:27,
from /Users/November/Documents/Arduino/libraries/SdFat/SdFat.h:36,
from sketch_dec12a.ino:2:
/Users/November/Documents/Arduino/libraries/SdFat/istream.h:144: error: 'istream& istream:perator>>(int16_t&)' cannot be overloaded
/Users/November/Documents/Arduino/libraries/SdFat/istream.h:126: error: with 'istream& istream:perator>>(short int&)'
/Users/November/Documents/Arduino/libraries/SdFat/istream.h:153: error: 'istream& istream:perator>>(uint16_t&)' cannot be overloaded
/Users/November/Documents/Arduino/libraries/SdFat/istream.h:135: error: with 'istream& istream:perator>>(short unsigned int&)'
In file included from /Users/November/Documents/Arduino/libraries/SdFat/ArduinoStream.h:26,
from /Users/November/Documents/Arduino/libraries/SdFat/SdFat.h:37,
from sketch_dec12a.ino:2:
/Users/November/Documents/Arduino/libraries/SdFat/bufstream.h: In member function 'virtual void ibufstream::getpos(fpos_t*)':
/Users/November/Documents/Arduino/libraries/SdFat/bufstream.h:62: error: request for member 'position' in '* pos', which is of non-class type 'long int'
/Users/November/Documents/Arduino/libraries/SdFat/bufstream.h: In member function 'virtual void ibufstream::setpos(fpos_t*)':
/Users/November/Documents/Arduino/libraries/SdFat/bufstream.h:73: error: request for member 'position' in '* pos', which is of non-class type 'long int'
Sorry, I know its a long post -- just wanted to get it all out there.
Kind Regards,
November
Code:
//#include <SD.h>
#include <SdFat.h>
//#include <Sd2Card.h>
//#include <SdVolume.h>
//#include <SdFile.h>
Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;
void setup() {
Serial.begin(9600);
card.init(SPI_FULL_SPEED);
volume.init(&card);
root.openRoot(&volume);
}
void loop(){
file.open(&root,"cat.txt",O_READ);
int16_t n;
uint8_t buf[7];
while ((n = file.read(buf, sizeof(buf))) > 0){
for (uint8_t i = 0; i < n; i++) Keyboard.print(buf[i]);
}
file.close();
}
Errors:
In file included from /Users/November/Documents/Arduino/libraries/SdFat/SdFile.h:24,
from /Users/November/Documents/Arduino/libraries/SdFat/SdFat.h:35,
from sketch_dec12a.ino:2:
/Users/November/Documents/Arduino/libraries/SdFat/SdBaseFile.h:36: error: using typedef-name 'fpos_t' after 'struct'
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/stdio.h:59: error: 'fpos_t' has a previous declaration here
In file included from /Users/November/Documents/Arduino/libraries/SdFat/iostream.h:26,
from /Users/November/Documents/Arduino/libraries/SdFat/SdStream.h:27,
from /Users/November/Documents/Arduino/libraries/SdFat/SdFat.h:36,
from sketch_dec12a.ino:2:
/Users/November/Documents/Arduino/libraries/SdFat/istream.h:144: error: 'istream& istream:perator>>(int16_t&)' cannot be overloaded
/Users/November/Documents/Arduino/libraries/SdFat/istream.h:126: error: with 'istream& istream:perator>>(short int&)'
/Users/November/Documents/Arduino/libraries/SdFat/istream.h:153: error: 'istream& istream:perator>>(uint16_t&)' cannot be overloaded
/Users/November/Documents/Arduino/libraries/SdFat/istream.h:135: error: with 'istream& istream:perator>>(short unsigned int&)'
In file included from /Users/November/Documents/Arduino/libraries/SdFat/ArduinoStream.h:26,
from /Users/November/Documents/Arduino/libraries/SdFat/SdFat.h:37,
from sketch_dec12a.ino:2:
/Users/November/Documents/Arduino/libraries/SdFat/bufstream.h: In member function 'virtual void ibufstream::getpos(fpos_t*)':
/Users/November/Documents/Arduino/libraries/SdFat/bufstream.h:62: error: request for member 'position' in '* pos', which is of non-class type 'long int'
/Users/November/Documents/Arduino/libraries/SdFat/bufstream.h: In member function 'virtual void ibufstream::setpos(fpos_t*)':
/Users/November/Documents/Arduino/libraries/SdFat/bufstream.h:73: error: request for member 'position' in '* pos', which is of non-class type 'long int'
Sorry, I know its a long post -- just wanted to get it all out there.
Kind Regards,
November