Compilation error

Feb 24, 2015 at 6:36 PM
I get the following errors when compiling pvoutput.ino (I assume this is the only one to compile and upload??):

Arduino: 1.6.0 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Build options changed, rebuilding all

In file included from C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:10:0:
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:18:18: error: variable 'monthStr1' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr1[] PROGMEM = "January";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:19:18: error: variable 'monthStr2' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr2[] PROGMEM = "February";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:20:18: error: variable 'monthStr3' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr3[] PROGMEM = "March";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:21:18: error: variable 'monthStr4' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr4[] PROGMEM = "April";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:22:18: error: variable 'monthStr5' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr5[] PROGMEM = "May";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:23:18: error: variable 'monthStr6' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr6[] PROGMEM = "June";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:24:18: error: variable 'monthStr7' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr7[] PROGMEM = "July";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:25:18: error: variable 'monthStr8' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr8[] PROGMEM = "August";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:26:18: error: variable 'monthStr9' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr9[] PROGMEM = "September";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:27:19: error: variable 'monthStr10' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr10[] PROGMEM = "October";
               ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:28:19: error: variable 'monthStr11' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr11[] PROGMEM = "November";
               ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:29:19: error: variable 'monthStr12' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr12[] PROGMEM = "December";
               ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:31:22: error: variable 'monthNames_P' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
PGM_P monthNames_P[] PROGMEM =
                  ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:37:26: error: variable 'monthShortNames_P' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthShortNames_P[] PROGMEM = "ErrJanFebMarAprMayJunJulAugSepOctNovDec";
                      ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:39:16: error: variable 'dayStr0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr0[] PROGMEM = "Err";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:40:16: error: variable 'dayStr1' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr1[] PROGMEM = "Sunday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:41:16: error: variable 'dayStr2' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr2[] PROGMEM = "Monday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:42:16: error: variable 'dayStr3' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr3[] PROGMEM = "Tuesday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:43:16: error: variable 'dayStr4' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr4[] PROGMEM = "Wednesday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:44:16: error: variable 'dayStr5' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr5[] PROGMEM = "Thursday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:45:16: error: variable 'dayStr6' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr6[] PROGMEM = "Friday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:46:16: error: variable 'dayStr7' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr7[] PROGMEM = "Saturday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:48:20: error: variable 'dayNames_P' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
PGM_P dayNames_P[] PROGMEM = { dayStr0,dayStr1,dayStr2,dayStr3,dayStr4,dayStr5,dayStr6,dayStr7};
                ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:49:24: error: variable 'dayShortNames_P' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayShortNames_P[] PROGMEM = "ErrSunMonTueWedThrFriSat";
                    ^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Feb 24, 2015 at 6:40 PM
Edited Feb 24, 2015 at 6:40 PM
Make sure you work, like Harold says in the Manual!!!!!!

This are to much errors...

Something bigs went wrong..
Feb 24, 2015 at 7:43 PM
I reinstalled Solarmeter completely, configured userdefs, as far as I know . Now I get issues with the DateString.cpp file. I tried to compile as ordinary user and as administrator (Windows 7). Bot gave the same problems:

Arduino: 1.6.0 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:10:0:
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:18:18: error: variable 'monthStr1' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr1[] PROGMEM = "January";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:19:18: error: variable 'monthStr2' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr2[] PROGMEM = "February";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:20:18: error: variable 'monthStr3' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr3[] PROGMEM = "March";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:21:18: error: variable 'monthStr4' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr4[] PROGMEM = "April";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:22:18: error: variable 'monthStr5' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr5[] PROGMEM = "May";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:23:18: error: variable 'monthStr6' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr6[] PROGMEM = "June";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:24:18: error: variable 'monthStr7' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr7[] PROGMEM = "July";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:25:18: error: variable 'monthStr8' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr8[] PROGMEM = "August";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:26:18: error: variable 'monthStr9' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr9[] PROGMEM = "September";
              ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:27:19: error: variable 'monthStr10' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr10[] PROGMEM = "October";
               ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:28:19: error: variable 'monthStr11' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr11[] PROGMEM = "November";
               ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:29:19: error: variable 'monthStr12' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthStr12[] PROGMEM = "December";
               ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:31:22: error: variable 'monthNames_P' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
PGM_P monthNames_P[] PROGMEM =
                  ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:37:26: error: variable 'monthShortNames_P' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char monthShortNames_P[] PROGMEM = "ErrJanFebMarAprMayJunJulAugSepOctNovDec";
                      ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:39:16: error: variable 'dayStr0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr0[] PROGMEM = "Err";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:40:16: error: variable 'dayStr1' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr1[] PROGMEM = "Sunday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:41:16: error: variable 'dayStr2' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr2[] PROGMEM = "Monday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:42:16: error: variable 'dayStr3' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr3[] PROGMEM = "Tuesday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:43:16: error: variable 'dayStr4' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr4[] PROGMEM = "Wednesday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:44:16: error: variable 'dayStr5' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr5[] PROGMEM = "Thursday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:45:16: error: variable 'dayStr6' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr6[] PROGMEM = "Friday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:46:16: error: variable 'dayStr7' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayStr7[] PROGMEM = "Saturday";
            ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:48:20: error: variable 'dayNames_P' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
PGM_P dayNames_P[] PROGMEM = { dayStr0,dayStr1,dayStr2,dayStr3,dayStr4,dayStr5,dayStr6,dayStr7};
                ^
C:\Program Files (x86)\Arduino\libraries\Time\DateStrings.cpp:49:24: error: variable 'dayShortNames_P' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
char dayShortNames_P[] PROGMEM = "ErrSunMonTueWedThrFriSat";
                    ^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Coordinator
Feb 24, 2015 at 8:41 PM
Unfortunately, the time library used by SolarMeter is not compatible with Arduino 1.6.
The compiler is more strict and requires a better definition of variables.
You have 3 options:
  1. Compile using Arduino 1.5
  2. Update the time library (can be found on the arduino site) to the latest version
  3. Remove DateStrings.cpp from the library. Solarmeter does not use this (but other projects might)
Soon I will update Solarmeter to be compatible with Arduino 1.6
Feb 24, 2015 at 8:52 PM

Hi Harold,

This works, compile and upload is now successful. Tomorrow I will connect it to my PV panels

Thanks for your prompt help!

Jan Pranger

Feb 25, 2015 at 9:07 PM

Harold,

Thanks for your help. Arduino is installed and works: http://pvoutput.org/list.jsp?id=4284&sid=3370.

Met vriendelijke groet, best regards,

Jan Pranger