ResponsiveAnalogRead icon indicating copy to clipboard operation
ResponsiveAnalogRead copied to clipboard

Compilation Error in Arduino 1.0.6 with ATmega8 microcontroller

Open abdul-rehman-2050 opened this issue 6 years ago • 1 comments

Hello! I tried to compile code with arduino 1.0.6 with Atmega8 microcontroller and got following error during compilation.

In file included from pulseWidthCalculator_V01.ino:3: C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:64: error: ISO C++ forbids initialization of member 'analogResolution' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:64: error: making 'analogResolution' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:64: error: ISO C++ forbids in-class initialization of non-const static member 'analogResolution' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:67: error: ISO C++ forbids initialization of member 'activityThreshold' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:67: error: making 'activityThreshold' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:67: error: ISO C++ forbids in-class initialization of non-const static member 'activityThreshold' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:68: error: ISO C++ forbids initialization of member 'edgeSnapEnable' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:68: error: making 'edgeSnapEnable' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:68: error: ISO C++ forbids in-class initialization of non-const static member 'edgeSnapEnable' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:72: error: ISO C++ forbids initialization of member 'errorEMA' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:72: error: making 'errorEMA' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:72: error: ISO C++ forbids in-class initialization of non-const static member 'errorEMA' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:73: error: ISO C++ forbids initialization of member 'sleeping' C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:73: error: making 'sleeping' static C:\Users\Strange Lab\Documents\Arduino\libraries\ResponsiveAnalogRead\src/ResponsiveAnalogRead.h:73: error: ISO C++ forbids in-class initialization of non-const static member 'sleeping'

abdul-rehman-2050 avatar Oct 22 '18 18:10 abdul-rehman-2050

You may try a less ancient version of the Arduino IDE. Alternatively, add the flag -std=c++11 to the options passed to gcc (you will have to dig deep into your IDE's configuration).

edgar-bonet avatar Oct 22 '18 19:10 edgar-bonet