ccharavrprogmem

What does "expected '=', ',', ';', 'asm' or '__attribute__' before 'char'" mean? AVR


// Sting for the Name
extern const PROGMEM char name[];

//Data structure of the Heap

typedef struct
{
  AllocStrategies strategy;
  uint16_t size;
  MemAddr start;
  MemDriver* driver;
  const PROGMEM char name[];
}Heap;

expected '=', ',', ';', 'asm' or '__ attribute__' before 'char'

Why do i get this error message twice?


Solution

  • You forgot to include a file:

    #include <avr/pgmspace.h>
    

    The PROGMEM attribute that allows you to allocate a const variable in program space is defined there.

    You are getting this error message twice because you are using PROGMEM twice.