.h or not to .h ... upgrading from 1.0.6 to 1.6.6 gives problems

I have an old project made using Arduino 1.0.6
inside some .h files I include in the beginning, I have code (not inside a function, only inside .h)
the reason for this code is to store strings in flash (it's a big project)

const char ModeCOP [22][11] PROGMEM = {
  //-12345678901234567890
  "Stabilize ",  //0
  "  string  ",  //1
...
  " another"}; //21
const char *flight_modeCOP[] = {
  ModeCOP[0],  ModeCOP[1], ModeCOP[2], ModeCOP[3], ModeCOP[4], ModeCOP[5],
  ModeCOP[6],  ModeCOP[7], ModeCOP[8], ModeCOP[9], ModeCOP[10], ModeCOP[11],
  ModeCOP[12], ModeCOP[13], ModeCOP[14], ModeCOP[15], ModeCOP[16],  ModeCOP[17],
  ModeCOP[18], ModeCOP[19], ModeCOP[20], ModeCOP[21]
};

I then access then by strcpy_P from ModeCOP[x]

  • this works fine on 1.0.6
    in 1.6.6 I get errors like
thirdcase.h:86: error: 'ModeCOP' was not declared in this scope
   ModeCOP[0],  ModeCOP[1], ModeCOP[2], ModeCOP[3], ModeCOP[4], ModeCOP[5],

the part of the code works in a new (clean) project when inserted into setup

So the question is: is it because it's inside included .h ? - or does it need to be inside a function , and if yes, will it still end up in FLASH ? , not flash AND program memory ?

Can you actually post the code involved, not just snippets? I can't tell from the tiny piece of code you posted what's wrong or how to fix it.

Re: terminology: "Flash" and "Program Memory" both refer to the same thing. The other type of memory is RAM, or SRAM.

It's a unholy pile of libraries and modified libraries and more errors (on 1.1.6) that I know how to resolve
I assume those who know, can answer on this isolated issue based on the information provided.

fixed it. :slight_smile:

aaaaaand.. the fix was?

I commented it out for now, as well as lines that did read it, then, after changing a lot of static void functions into void , it suddently started to work - so the syntax was ok (i suspected the commands because I had const prog_char Mode... before and recently changed it.)