Unresolved External Symbol

I'm getting 4 unresolved external symbol errors when I compile my code, but I don't know what's going on! All of the errors are pointing to 4 static variables within a class, but it's not pointing to any line. I got this after adding an argument to some constructors to set a variable in a completely different class, but now I'm getting this!

I have 4 pieces of source code, all defining a header, which might be the problem. But since it was working before I added those extra arguments, that's probably not it. I'll copy and paste the parts that define the problem variables:

static MANAGER_SLOT *first_slot, *last_slot;
static int size, sprites;

The MANAGER_SLOT class has been defined already, and I'm initializing the variables in my main( ) function. I changed a single function in this class, which added a single argument so that it could use the constructors for a few other classes properly. I never touched those variables at any time while adding the arguments.

I don't know if this will be of any help, but I'm using Visual C++ 2008 Express Edition as an IDE.
Last edited on
Static class members must be defined somewhere (in a similar way functions are)
eg:
1
2
3
4
5
6
7
//In the header file:
class C
{
    static int foo;
};
//In a source file:
int C::foo = 123;
Last edited on
I tried it with first_slot, and it worked! Thanks!
Topic archived. No new replies allowed.