I have a public static int as one of my member variables for a class, but when I go to increment it (I can only have 8 instances of this class) the compiler gives me a LNK2001 error.
I have written the code exactly how it is written in a C++ book but for some reason it still will not work;
Code:
class Light {
public:
Light(); //DEFAULT CONSTRUCTOR, THIS WILL MAKE THE LIGHT FULLBRIGHT, MEANING COMPLETELY WHITE
Light(color_t*, material_t*, location_t*); //THIS IS THE CONSTRUCTOR THAT WILL ALLOW FOR ALL OF THE PARAMETERS OF THE LIGHT TO BE SET
void Activatate();
void Deactivate();
short Number;
static int NumberOfLights; //FOR NOW WE WILL NOT BE ABLE TO CREATE ANY MORE THAN 8 LIGHTS UNTIL WE CAN CULL THE REST
private:
color_t *Color;
material_t *Material;
location_t *Location;
};
That is the class interface file, and the constructor simply increments it. Please help me fix this stupid little problem.