Sketch won't compile, library file errors.

Some months back I downloaded a sketch to make an adjustable clock with a max7219 display, which has worked fine .

Now I want to make another one for someone else, but there are 2 error2 in a library file and the sketch does not compile.
I compiled ok previously!

These are the errors:
home/rob/sketchbook/libraries/LedControl/src/LedControl.h:42:7: error: expected unqualified-id before 'static'
const static byte charTable [] PROGMEM = {
/home/rob/sketchbook/libraries/LedControl/src/LedControl.h:42:7: error: expected constructor, destructor, or type conversion before 'static'

These are the libraries used for the project:

//include libraries:
#include <LedControl.h>
#include <FontLEDClock.h> // Font library
#include <Wire.h> // DS1307 clock
#include <RTClib.h> // DS1307 clock
#include <Button.h> // Button library by Alexander Brevig

I am stumped as to why it should just develop these errors, as I have not changed or edited the said file.
I have redownloaded the same library from Github, but still the same errors

The sketch is almost 1600 lines long and that is why I have not included it in this post.


max7219_clock_Success.ino (43.5 KB)

What is your target board? If you changed that in the IDE while doing a different project (Uno/Nano/ESP2866/...) then you might get an error.

Sorry, the board is an Arduino Uno, and I have made sure that it is selected, also I can get the board info.

Yes I have done a couple of different projects since using a nano board, but did change it back to the Uno.

Link to the version of LedControl library you are using?

I'm not sure whar I got the library files from but according to my library manager it is vcersion 1.0.6 by Eberhard Fahle which is installed.

I re included it and there is no error from that file????

Now I am getting an error for another library file:

home/rob/sketchbook/libraries/MAx7219Clocklibraries/FontLEDClock.h:3:7: error: expected unqualified-id before 'int'
const int font_count = 80;
/home/rob/sketchbook/libraries/MAx7219Clocklibraries/FontLEDClock.h:3:7: error: expected constructor, destructor, or type conversion before 'int'


Ok, I have re downloaded the sketch and now it wont compile with this error:

lto1: internal compiler error: in lto_output_varpool_node, at lto-cgraph.c:624
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
lto-wrapper: fatal error: /opt/arduino-1.8.8/hardware/tools/avr/bin/avr-gcc returned 1 exit status
compilation terminated.
/opt/arduino-1.8.8/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Is this the actual sketch at fault or the Arduin IDE

I downgraded the IDE to 1.6.21 from 1.6.23, and that has fixed the errors.

Thanks for the time.

It's no longer necessary to downgrade Arduino AVR Boards from 1.6.23 to 1.6.21 to fix this error. Instead, you should upgrade from Arduino AVR Boards 1.6.23 to the newly released 1.8.1, which has this bug fixed.