PROGMEM with a class member doesn't work

Why does the compiler not recognize the const in the declaration of these class members?

In file included from C:\Users\greg\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.12\cores\arduino/Arduino.h:28:0,

from sketch\Program.cpp:1:

Program.cpp:13: error: variable ‘CProgram::m_strProgramFilename’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’

const char* CProgram::m_strProgramFilename PROGMEM = “program.txt”;

^

Program.cpp:14: error: variable ‘CProgram::m_strAlarmsFilename’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’

const char* CProgram::m_strAlarmsFilename PROGMEM = “alarms.txt”;

^

exit status 1
variable ‘CProgram::m_strProgramFilename’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’

header file:

class CProgram
{
  public:
     // Construction, destruction and initialisation
     CProgram();
     virtual ~CProgram();

    // Interface
    bool read();
    void dump();
    void run();
    void begin();
    CProgramStation* getStationDetails(uint8_t nI);
    CTime& checkAlarms(CWifi& WifiServer, CTime& timeLast);
    int8_t isRunning();
    void runStation(uint8_t nStation, uint16_t nMinutes);

  protected:
    // Helper functions 

    // Data
    CProgramStation m_arrayStations[MAX_SATIONS];
    static const uint8_t m_arrayRelayPinNums[MAX_SATIONS];
    static const uint8_t m_arrayProbePinNums[MAX_SATIONS];
    static const char* m_strProgramFilename;
    static const char* m_strAlarmsFilename;

} ;

source file:

const char* CProgram::m_strProgramFilename PROGMEM = "program.txt";
const char* CProgram::m_strAlarmsFilename PROGMEM = "alarms.txt";

Program.cpp (4.55 KB)

Program.h (889 Bytes)

You've made a non-const pointer to a const string. Try like this:

const char* const CProgram::m_strProgramFilename PROGMEM = "program.txt";

Although read here: Gammon Forum : Electronics : Microprocessors : Putting constant data into program memory (PROGMEM)

I'm not sure if it's the string or the pointer that went into PROGMEM this way.

Delta_G:
You've made a non-const pointer to a const string. Try like this:

const char* const CProgram::m_strProgramFilename PROGMEM = "program.txt";

Although read here: Gammon Forum : Electronics : Microprocessors : Putting constant data into program memory (PROGMEM)

I'm not sure if it's the string or the pointer that went into PROGMEM this way.

Never used const like that before, but it worked so thanks.