This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Does anyone know why can't I access member variables from within __interrupt?
bb. private:
dd. };
That is the linker reporting the unresolved symbol, rather than the compiler. You need to define the static member "uartRcvIndex". i.e. try adding the following to the .cpp file which defines the class:Ken Yeh said:Compiler complains:
- undefined first referenced
- symbol in file
- --------- ----------------
- __HHI__::UARTBuffer::uartRcvIndex ./Source Files/UARTBuffer.obj
unsigned char UARTBuffer::uartRcvIndex;
hi Chester,
thanks for the reply.
uartRcvIndex is defined as static in the class UARTBuff though.
It's only *declared* in the class. It still needs to be *defined* someplace.
The class declaration is roughly equivalent to having "extern uchar uartRcvIndex;" in the header file. You would still need "uchar uartRcvIndex;" in a single source file to create the variable.