Must be const in order to be put into read-only error

I've seen a couple similar questions, but nothing I have found so far has worked.

For this part of code:

#include "hidescriptorparser.h"

const char * ReportDescParserBase::usagePageTitles0[] PROGMEM =
{
pstrUsagePageGenericDesktopControls ,
pstrUsagePageSimulationControls ,
pstrUsagePageVRControls ,
pstrUsagePageSportControls ,
pstrUsagePageGameControls ,
pstrUsagePageGenericDeviceControls ,
pstrUsagePageKeyboardKeypad ,
pstrUsagePageLEDs ,
pstrUsagePageButton ,
pstrUsagePageOrdinal ,
pstrUsagePageTelephone ,
pstrUsagePageConsumer ,
pstrUsagePageDigitizer ,
pstrUsagePagePID ,
pstrUsagePageUnicode
};

I'm getting the error:
error: variable 'ReportDescParserBase::usagePageTitles0' must be const in order to be put into read-only section by means of 'attribute((progmem))'
const char * ReportDescParserBase::usagePageTitles0[] PROGMEM =

Some of the other things I've seen has said that you have to do

const char const *

at the beginning, but I haven't had any luck with that either. Any ideas?

const char * const ReportDescParserBase::usagePageTitles0[] PROGMEM =
{

works :wink:

With that it's giving me

error: conflicting declaration 'const char* const ReportDescParserBase::usagePageTitles0 []'
const char * const ReportDescParserBase::usagePageTitles0[] PROGMEM=
^

Do I also have to change something in the hidescriptorparser.h that I have included at the top? It contains the line:

static const char *usagePageTitles0[];

Is something there conflicting with the const char * const line in the other file? I can post more of that code if you think that something else is the problem.

Thanks for your help!

You will need something like

class ReportDescParserBase {
 static const char * const usagePageTitles0[];

in hidescriptorparser.h.

That worked. Thank you!

It is likely one of the elements of the array that are not fixed.
I'm not familiar enough with C but it is also possible
that even being a fixed value, they have to exist in the program
before they are used to build this array.
I know general global variables need to be defined a head of
usage.
I see Whandall has provided you with a solution.
Dwight