Hi,

I have the following case:
I have a static member variable (NOT const!), that should manage unique information shared by all class instances, and I would like to initialize that variable one time.
This is what I did:
Header:
Qt Code:
  1. class FrmPower : public QWidget
  2. {
  3. Q_OBJECT
  4. public:
  5. typedef enum { NONE=0,A,B,C,D } BUS;
  6. private:
  7. static BUS m_BorC;
  8. //rest of the class
  9. };
To copy to clipboard, switch view to plain text mode 
And in the implementation file (cpp) (in global scope):
Qt Code:
  1. FrmPower::BUS m_BorC = FrmPower::NONE;
To copy to clipboard, switch view to plain text mode 
But I get multiple definition linking error for 'm_BorC' which I don't get, since it is not visible outside the implementation of FrmPower.

Any idea how to resolve this?

Thanks in advance.