Since I am a newbie to CW, please excuse me for such a elementary question.
I'm using CW 6.3 with M5211DEMO board. In the M5211DEMO_SRAM.lcf file, I declare a buffer as: ___BUF_SIZE = 0x400; ___BUF_START = ___HEAP_END; ___BUF_END = ___BUF_START + ___BUF_SIZE;
I want to use these symbols, so in a header file (test.h), I re-define them as: #define BUF_START ___BUF_START #define BUF_SIZE ___BUF_SIZE
In the main program, I include "test.h" and use BUF_START and BUF_SIZE in main(). However, when I compile, I got the error message saying that ___BUF_START and ___BUF_SIZE are undefined identifiers.
You have to have a declaration of any identifier in C. Add something like this to your header file: extern char ___BUF_START[]; extern char ___BUF_SIZE[];
Dont add a definition as the lcf is used to define those symbols.