Maintenance notice: These forum archives are read-only, and will be removed shortly. Please visit our forums at their new location, https://www.evilmadscientist.com/forums/.

alpha Five compile errors

edited November 2013 in Clock Kits
Arduino 1:1.0.5+dfsg2-1

Same errors with two install on two linux machines following wiki procedures and latest files.

Any suggestions would be welcome.

Tim

IIn file included from AlphaClock.ino:61:0:
/home/down-lap/sketchbook/libraries/alphafive/fiveletterwords.h:29:35: error: variable ‘fiveLetterPosArray’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
In file included from AlphaClock.ino:61:0:
/home/down-lap/sketchbook/libraries/alphafive/fiveletterwords.h:31:24: error: variable ‘fiveLetterWords’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’

Comments

  • The wiki does specify Arduino 1.0.3 as the required software, so that's only *almost* following wiki procedures. ;)

    In any case, I've downloaded 1.0.5, and I am unable to reproduce your error (at least on a Mac).  The error may have to do with the underlying version of avr-libc installed on your computer.   

    You might try opening up the file in question (fiveletterwords.h) and adding the word "const" in front of that variable definition, like so: 
    const unsigned int fiveLetterPosArray
    to see if that fixes it for you.
  • This is the has-gotten-to-be-standard push-me-pull-you with the PROGMEM attribute and avr-gcc.  I battle this regularly myself as I go between different avr code bases which use different variations on this, each variation intended to appease some specific version of the gcc underlying avr-gcc.  (If you turn on the detailed logging in the Arduino app, it's not at all unusual to see compile time warnings relating to progrmem as Arduino library code is compiled in.  But those are just warnings and not errors such as here.)

    I tend to get the best mileage out of this particular incantation,

    const static PROGMEM unsigned int fiveLetterPosArray[] = {363, ... };

    You might also try

    prog_int16_t fiveLetterPosArray[] PROGMEM = {363, ...};

    which is the "official" Arduino way (http://arduino.cc/en/Reference/PROGMEM). But that tends to just mean you get a warning and not an error.
  • switched to the specified 1.0.3 and all is well.

    Thank you all.
Sign In or Register to comment.