Hi,
I'm using a 9S08QE8 and wish to declare an array of constant ints into ROM and be able to reference them from another module.
I have used :
const static unsigned int page_table[] = {.........};
in the .h files with
extern unsigned int page_table[31];
to declare it to other modules.
I get linker error L1823 as well as an out of RAM error (because it has put it in RAM).
Can someone point me in the right direction. I have spent all afternnon trying to get this right. It sounds simple enough.
Thanks
Steve
Solved! Go to Solution.
I would make the declaration const too:
extern const unsigned int page_table[31];
Additionally, if you have it extern, then do *not* use static for the implementation:
const unsigned int page_table[] = {.........};
I hope this helps.
I would make the declaration const too:
extern const unsigned int page_table[31];
Additionally, if you have it extern, then do *not* use static for the implementation:
const unsigned int page_table[] = {.........};
I hope this helps.
Hi Erich,
That seems to have sorted it. Many thanks. I will need to understand what I did wrong so I don't make the same mistake again. Back to the books!