const __FlashStringHelper* no more recognized !

Hello,

I just upgraded from Arduino 1.0.6 to 1.6.6 and have a problem with const FlashStringHelper*. I use this a lot to gain space in RAM, storing chars in flash, but the compiler now gives me an error : "error: 'constFlashStringHelper' does not name a type".

Does any body know what have changed that I explain this error and how I can make through ?

Example of code : printToScreen(const __FlashStringHelper*MyText) {...}

const __FlashStringHelper* MyText = F("Hello"); printToScreen(MyText);

Thierry

Example of code :

No. No. No. Post the ACTUAL code. All of it.

OK, sorry, I did not want to be too long.
My code works perfectly with Arduino 1.0.6, but I get the error with new version.

const __FlashStringHelper* CnxReseau = F(“Cnx Res.”);
Texte(CnxReseau, 10, 140, 1, 255);

int Texte(const __FlashStringHelper* Chaine, INT16U poX, INT16U poY, INT16U Npolice, INT16U fgcolor)
{
const char PROGMEM *p = (const char PROGMEM *)Chaine;
while (pgm_read_byte(p)!=0) poX += Caractere(pgm_read_byte(p++), poX, poY, Npolice, fgcolor, Ecrase);
return poX;
}

byte Caractere(byte Caract, INT16U poX, INT16U poY, INT16U Npolice, INT16U Couleur)
{
#define Espacement 2 // Espacement entre caractères en points
INT16U Npolice_1=Npolice-1;

byte Largeur = pgm_read_word(&Police1_Info[Caract-’ ‘][0]);
unsigned int Adresse = pgm_read_word(&Police1_Info[Caract-’ '][1]);
if (Largeur==0) return 0;

byte NbByte= (Largeur-1)/8+1;
byte Hauteur= (pgm_read_word(&Police1_Info[Caract-’ '+1][1])-Adresse)/NbByte;
while(poX+Largeur>MAX_X) { poX-=MAX_X; poY+=15; }
if (poY+Largeur>MAX_Y) { poY-=MAX_Y; }

for (byte y=0; y<Hauteur; y++)
{
for(byte nByte=0; nByte<NbByte; nByte++)
{
INT8U Octet = pgm_read_byte(&Police1[Adresse++]);
for(INT8U x=0;x<8;x++)
if((Octet<<x)&0b10000000) RectanglePlein(poX+(x+(nByte)8)Npolice, poY+yNpolice, Npolice_1, Npolice_1, Couleur);
else if (Ecrase && x+8
nByte<Largeur) RectanglePlein(poX+(x+(nByte)*8)Npolice, poY+yNpolice, Npolice_1, Npolice_1, 0);
}
}

return LargeurNpolice+EspacementNpolice;
}

You have not done as PaulS asked.

(1) Autoformat your code by using CTRL-T in the Arduino IDE.
(2) Copy ALL of the code and paste it using code tags - the </> button will help with this.

I don’t see a setup() function, I don’t see a loop() function, I especially don’t see any #include statements, and I DO see a couple of smiley faces wearing sunglasses. We can’t help you like this.
Good Luck!

This is a bug in the new arduino-builder introduced in 1.6.6. Try 1.6.5 or an hourly build.

https://github.com/arduino/arduino-builder/issues/69

OK Vaj4088, I understand. However my code is more than 2000 lines, so I am not sure this will really help to copy it all.

But I think that oqibidipo got it !!!

In fact the error I get is "error: 'const__FlashStringHelper' does not name a type" but it should be more something like "error: 'const __FlashStringHelper' does not name a type", with a space between const and __FlashStringHelper.

So you are right, it a bug of new arduino-builder 1.6.6.

Thanks again !

If you write your own prototype for the function at the top of the code does it go away?