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.

TMS320F28069M: Resolving static class variables by linker

Part Number: TMS320F28069M


Why am I unable to use a static class variable in my code when using standard 28069_RAM_lnk.cmd?

Error given (at link time): undefined symbol ADC:nAdcClassVariable.

I can use a global to accomplish the same behavior, but I'd like to use a class variable.

//------------------------------------------------------------------------------ // ADC class //------------------------------------------------------------------------------ class ADC { public: static int nAdcClassVariable; static void InitModule( void ); }; //------------------------------------------------------------------------------ //Initialization of ADC Module //------------------------------------------------------------------------------ void ADC::InitModule() { nAdcClassVariable = 4; //link error when trying to use/assign class variable return; }