Compilation error arduino 1.7.8

Dec 1, 2015 at 12:43 PM
Harold,
After 3 years of using the Meterkast sketch and Arduino version 023 made by Johan Bosma 2011/21/06 I have to change the Arduino version because of java8.
I tried the sketch of 1.6.5 but wind up with many fault by compiling and not be able to insert the software in my Arduino one
I have insert the Solarmeter V11.41 sketch into the 1.7.8 aduino but the verifier field is far from empty.

Arduino: 1.7.8 (Windows 8.1), Board:"Arduino Uno"

In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/socket.h:4:0,
             from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:8:
C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/w5100.h:56:7: error: redefinition of 'class SnMR'

class SnMR {
   ^
In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:7:0:

C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src/utility/w5500.h:47:7: error: previous definition of 'class SnMR'

class SnMR {
   ^
In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/socket.h:4:0,
             from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:8:
C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/w5100.h:68:6: error: multiple definition of 'enum SockCMD'

enum SockCMD {
  ^
In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:7:0:

C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src/utility/w5500.h:59:6: error: previous definition here

enum SockCMD {
  ^
In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/socket.h:4:0,
             from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:8:
C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/w5100.h:94:7: error: redefinition of 'class SnIR'

class SnIR {
   ^
In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:7:0:

C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src/utility/w5500.h:85:7: error: previous definition of 'class SnIR'

class SnIR {
   ^
In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/socket.h:4:0,
             from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:8:
C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/w5100.h:103:7: error: redefinition of 'class SnSR'

class SnSR {
   ^
In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:7:0:

C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src/utility/w5500.h:94:7: error: previous definition of 'class SnSR'

class SnSR {
   ^
In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/socket.h:4:0,
             from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:8:
C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet\src/utility/w5100.h:122:7: error: redefinition of 'class IPPROTO'

class IPPROTO {
   ^
In file included from C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src\utility\socket.cpp:7:0:

C:\Users\Dick\Documents\arduino 1.78\arduino-1.7.8\libraries\Ethernet2\src/utility/w5500.h:113:7: error: previous definition of 'class IPPROTO'

class IPPROTO {
   ^
Fout bij compileren.

Dit rapport zou meer informatie hebben met
"Tijdens de compilatie uitgebreide uitvoer weergeven"
ingeschakeld in Bestand > Voorkeuren.

These error are not to corrected by me in the users page either in the solarmeter setup.
What went wrong with my installation?
I use WIN 10/64 and JAVA 8+ is installed
http://www.pvoutput.org/display.jsp?sid=6834
Coordinator
Dec 1, 2015 at 4:40 PM
Dick,

These errors are mostly caused by a wrong location of the libraries used by the project.
Arduino searches in multiple locations for libraries. If you have the same library in multiple of them you get the 'redefinition' error.

I think you have copied library 'ethernet' to 'ethernet2'. Both use the same definitions. Remove one of them
Dec 1, 2015 at 10:07 PM
Thanks Harold. I go ahead with your advice. Your response could not been faster! 😀

Op 1 dec. 2015 om 17:42 heeft Harold65 <[email removed]> het volgende geschreven:

From: Harold65

Dick,

These errors are mostly caused by a wrong location of the libraries used by the project.
Arduino searches in multiple locations for libraries. If you have the same library in multiple of them you get the 'redefinition' error.

I think you have copied library 'ethernet' to 'ethernet2'. Both use the same definitions. Remove one of them
Dec 2, 2015 at 8:54 PM
I try and my foult report is slightly better. Change userdef.h is not easy, but finally alright. The only foult I have is the following

Arduino: 1.7.8 (Windows 8.1), Board:"Arduino Uno"

In file included from C:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\libraries\Time\DateStrings.cpp:10:0:

C:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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:\Users\Dick\Documents\DianaHHW\arduino-1.7.8\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";
                    ^
Fout bij compileren.

Dit rapport zou meer informatie hebben met
"Tijdens de compilatie uitgebreide uitvoer weergeven"
ingeschakeld in Bestand > Voorkeuren.

Time is included in the libraries but?
Dec 3, 2015 at 7:27 PM
Copy from your answer to JanP

Coordinator
Feb 24 at 9: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:
Compile using Arduino 1.5
Update the time library (can be found on the arduino site) to the latest version
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

This helps me a lot. I downloaded Arduino 1.5.8 Mac Version OSX. The libaries are not like Windows to be placed in the Arduino sketch but have to be imported, except the DateString.ccp, because with this file the compilation shows time faults.
I load the sketch and it looks good. Take some time to combine the Arduino into man solarsysten, but I let you know
Until so far, thank you.

Dirk Schaap
Dec 5, 2015 at 11:16 AM
Thanks Harold it works.
http://www.pvoutput.org/intraday.jsp?id=4538&sid=6834. The results are lower as actual. My ferraris 600rpm/kW is hooked up, the 1000pulses/kW as included in the calc of the software is waiting to connect next week