Hi, ive tried everything I can think of and didnt managed to solve it.
this is a function that I have in an .h file included in the main .ino file
boolean load_2Dtable_fromSD(table2D& dest,char* filename) {
FILE tableFile;
if( !SD.begin() ) { //can we do that again if its already done in setup() ?
Serial.println("load_table_fromSD:error loading SD card");
return false; }
if( !SD.exists(filename) ) {
Serial.println("load_table_fromSD:cant open, file doesnt exists");
return false; }
tableFile=SD.open(filename,FILE_READ);
if(!tableFile) {
Serial.println("load_table_fromSD:file exists but cant open file as FILE_READ");
return false; }
//if we made it here, we can read from the file - assuming the
//file is formatted well. if not - garbage in garbage out...
//allocate memory
dest.values = (int *)malloc(dest.values, dest.xSize * dest.xSize * sizeof(int));
dest.axis_x = (int *)malloc(dest.axis_x, dest.xSize * sizeof(int));
//load axis_x (can unite with axis_y for runtime)
for(int i=0;i<dest.xSize;i++)
dest.axis_x[i]=tableFile.parseInt();
//load values
for(int i=0;i<dest.xSize;i++)
dest.values[i]=tableFile.parseInt();
return true; //indicate success
}
and I am getting this error
Galileo_SD.h:25:37: note: candidate is:
In file included from C:\arduino-1.5.3/hardware/tools/x86/i586-poky-linux-uclibc/usr/include/stdio.h:71:0,
from C:\arduino-1.5.3\hardware\arduino\x86\cores\arduino/Print.h:24,
from C:\arduino-1.5.3\hardware\arduino\x86\cores\arduino/Stream.h:26,
from C:\arduino-1.5.3\hardware\arduino\x86\cores\arduino/HardwareSerial.h:24,
from C:\arduino-1.5.3\hardware\arduino\x86\cores\arduino/TTYUART.h:5,
from C:\arduino-1.5.3\hardware\arduino\x86\variants\galileo_fab_d/variant.h:20,
from C:\arduino-1.5.3\hardware\arduino\x86\cores\arduino/Arduino.h:15,
from Galileo.ino:2:
C:\arduino-1.5.3/hardware/tools/x86/i586-poky-linux-uclibc/usr/include/bits/uClibc_stdio.h:162:8: note: __STDIO_FILE_STRUCT& __STDIO_FILE_STRUCT::operator=(const __STDIO_FILE_STRUCT&)
C:\arduino-1.5.3/hardware/tools/x86/i586-poky-linux-uclibc/usr/include/bits/uClibc_stdio.h:162:8: note: no known conversion for argument 1 from 'File' to 'const __STDIO_FILE_STRUCT&'
In file included from Galileo.ino:8:0:
Now if anyone knows whats wrong, or can direct me to the problem...itll be great
thanks!