error: expected unqualified-id before '.' token

Need help, I can´t find the error.

In file included from bitmaps.cpp:2:
bitmaps.h:6: error: expected unqualified-id before ‘.’ token
bitmaps.cpp:4: error: expected unqualified-id before ‘.’ token

bitmaps.h

#ifndef bitmaps.h
#define bitmaps.h

#include <avr/pgmspace.h>

extern prog_uchar bitmaps[];

#endif

bitmaps.cpp

#include "bitmaps.h"

PROGMEM prog_uchar bitmaps[] = {

  // N
  5,5,
  0b10001000,
  0b11001000,
  0b10101000,
  0b10011000,
  0b10001000,

  // E
  5,5,
  0b11111000,
  0b10000000,
  0b11111000,
  0b10000000,
  0b11111000,

  // S
  5,5,
  0b01111000,
  0b10000000,
  0b01110000,
  0b00001000,
  0b11110000,

  // W
  5,5,
  0b10001000,
  0b10001000,
  0b10101000,
  0b10101000,
  0b01010000,

  // home
  6,6,
  0b00110000,
  0b01111000,
  0b11111100,
  0b01111000,
  0b01011000,
  0b01011000

};

Could you try : extern PROGMEM prog_uchar bitmaps;

Change:

#ifndef bitmaps.h
#define bitmaps.h

to:

#ifndef bitmaps_h
#define bitmaps_h

or even better:

#ifndef BITMAPS_H
#define BITMAPS_H

Thank you guys!

I try it all, but have no success. =´(

In file included from bitmaps.cpp:2:0:
bitmaps.h:6:16: error: 'prog_uchar' does not name a type
 extern PROGMEM prog_uchar bitmaps[];
                ^
bitmaps.cpp:4:16: error: 'prog_uchar' does not name a type
 extern PROGMEM prog_uchar bitmaps[] = {

At least seems that the problem changed.

You can change ‘prog_uchar’ to ‘uint8_t’.

I’m not sure about it, but you can try to add: #include <Arduino.h>

After finding the file avr/pgmspace.h, I can say that:

extern prog_uchar bitmaps[];

this is right.

And this:

PROGMEM prog_uchar bitmaps[] = {

don't seems right.

So try to do:

extern uint8_t bitmaps[] PROGMEM = {

and:

uint8_t bitmaps[] PROGMEM = {

include the file "avr/pgmspace.h" into your code.

Also, only the array definition needs PROGMEM, the declaration does not. As you already specify PROGMEM, prog_xxx isn't needed either. Just use unsigned char or uint8_t.

Also, to keep your code usable with the IDE 1.5.7 and above, add const.

//Header
extern const unsigned char bitmaps[]; 

//cpp file
extern const unsigned char bitmaps[] PROGMEM = { /** values **/ };

@pYro_65: You don't need the extern in the cpp file, right?

No, I just like to leave it in.

extern only needs to be located where it can be seen by multiple source files. However seeing it in someone else's code instantly tells me that changing the variable declaration in the file scope (.cpp) will break something elsewhere, or simply not compile.