0

Linker error: tried to make basic cpp program but there is a linker error saying:unresolved symbol "private: static int complex::count". When i removed the static words, its working fine.

Please find Program sample on this link

Barmar
  • 669,327
  • 51
  • 454
  • 560

1 Answers1

0

you must explicitly define your static variable outside of the class. For example like this:

class complex {
   ....
   int static count;
   ....
};
// initialization
int complex::count = 0;
iskakoff
  • 76
  • 4