If you need ROM maps in memory that you will access in different compilation units you can allocate the memory in the first unit:
extern const unsigned char BPG_Arial29x32[] = {
// Font Info
0x00, // Unknown #1
0x00, // Unknown #2
...
}
In the other unit there are two options to declare in the headers:
extern const unsigned char* BPG_Arial29x32;
OR
extern const unsigned char BPG_Arial29x32[];
The second is always working, and the first let the software 'hang' if you use it in that way:
inline static map<const unsigned char*, const char*> fontSoftToString = {
{BPG_Arial29x32, "BPG_Arial29x32"}
};
inline static map<string, const unsigned char*> stringToSoftFont = {
{"BPG_Arial29x32", BPG_Arial29x32}
};
But it works if you use it as a function parameter:
declare: SetTextFontRom(const unsigned char* font)
use: SetTextFontRom(BPG_Arial29x32);
Why is this and why this is not 'compatible'?