Static variables in classes not allowed
Posted: Tue Jun 01, 2010 9:59 am
Hi! I have a new problem today, the static vars. This is a sample of class that uses them
The problem is the red line. The linker isn't able to manage it so it tries to link it in every section. How to solve this problem? Now I'm using it out from the class but it makes the code less readable
Code: Select all
class frame{
private:
[color=#804000][b]static uint32 nextId;[/b][/color]
uint32 id;
uint8 refreshed;
frame* parent;
frame* children[128];
uint8 status; //Visible enabled etc etc
uint16 width, height, top, left;
uint32 zindex;
public:
static void init_frame();
frame(frame* a_p, uint16 a_w, uint16 a_h, uint16 a_t, uint16 a_l, uint32 a_z);
frame();
void refresh();
void* draw(frame*); //TO draw
}nullFrame;