Time.h compiling error
i've found few instances of on forums searching, none same i'm seeing.
i won't post code because i'm trying output time sample sketch comes library. time library folder in library folder, belongs, tried copying .cpp , .h files root of the library folder suggested in thread, no avail. sketch #include <time.h> throws errors when compile. here errors:
as errors "variable needs const" tried changing char lines in .cpp file const. didn't work. i'm hoping easy, , i'm missing because it's 11pm , i've had few bourbons. in advance.
/yes, laptop's name lappy.
i won't post code because i'm trying output time sample sketch comes library. time library folder in library folder, belongs, tried copying .cpp , .h files root of the library folder suggested in thread, no avail. sketch #include <time.h> throws errors when compile. here errors:
code: [select]
in file included /home/lappy/sketchbook/libraries/time/datestrings.cpp:10:0:
/home/lappy/sketchbook/libraries/time/datestrings.cpp:18:18: error: variable 'monthstr1' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr1[] progmem = "january";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:19:18: error: variable 'monthstr2' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr2[] progmem = "february";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:20:18: error: variable 'monthstr3' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr3[] progmem = "march";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:21:18: error: variable 'monthstr4' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr4[] progmem = "april";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:22:18: error: variable 'monthstr5' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr5[] progmem = "may";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:23:18: error: variable 'monthstr6' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr6[] progmem = "june";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:24:18: error: variable 'monthstr7' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr7[] progmem = "july";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:25:18: error: variable 'monthstr8' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr8[] progmem = "august";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:26:18: error: variable 'monthstr9' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr9[] progmem = "september";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:27:19: error: variable 'monthstr10' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr10[] progmem = "october";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:28:19: error: variable 'monthstr11' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr11[] progmem = "november";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:29:19: error: variable 'monthstr12' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr12[] progmem = "december";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:31:22: error: variable 'monthnames_p' must const in order put read-only section means of '__attribute__((progmem))'
pgm_p monthnames_p[] progmem =
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:37:26: error: variable 'monthshortnames_p' must const in order put read-only section means of '__attribute__((progmem))'
char monthshortnames_p[] progmem = "errjanfebmaraprmayjunjulaugsepoctnovdec";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:39:16: error: variable 'daystr0' must const in order put read-only section means of '__attribute__((progmem))'
char daystr0[] progmem = "err";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:40:16: error: variable 'daystr1' must const in order put read-only section means of '__attribute__((progmem))'
char daystr1[] progmem = "sunday";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:41:16: error: variable 'daystr2' must const in order put read-only section means of '__attribute__((progmem))'
char daystr2[] progmem = "monday";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:42:16: error: variable 'daystr3' must const in order put read-only section means of '__attribute__((progmem))'
char daystr3[] progmem = "tuesday";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:43:16: error: variable 'daystr4' must const in order put read-only section means of '__attribute__((progmem))'
char daystr4[] progmem = "wednesday";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:44:16: error: variable 'daystr5' must const in order put read-only section means of '__attribute__((progmem))'
char daystr5[] progmem = "thursday";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:45:16: error: variable 'daystr6' must const in order put read-only section means of '__attribute__((progmem))'
char daystr6[] progmem = "friday";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:46:16: error: variable 'daystr7' must const in order put read-only section means of '__attribute__((progmem))'
char daystr7[] progmem = "saturday";
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:48:20: error: variable 'daynames_p' must const in order put read-only section means of '__attribute__((progmem))'
pgm_p daynames_p[] progmem = { daystr0,daystr1,daystr2,daystr3,daystr4,daystr5,daystr6,daystr7};
^
/home/lappy/sketchbook/libraries/time/datestrings.cpp:49:24: error: variable 'dayshortnames_p' must const in order put read-only section means of '__attribute__((progmem))'
char dayshortnames_p[] progmem = "errsunmontuewedthrfrisat";
as errors "variable needs const" tried changing char lines in .cpp file const. didn't work. i'm hoping easy, , i'm missing because it's 11pm , i've had few bourbons. in advance.
/yes, laptop's name lappy.
quote
i won't post code because i'm trying output time sample sketch comes libraryi don't think reason not post code , link got library.
Arduino Forum > Using Arduino > Programming Questions > Time.h compiling error
arduino
Comments
Post a Comment