Note that static does not mean the same thing as const, so I'm a bit confused as to what you're actually trying to achieve.
const makes a member variable constant. That means, its value must be set in the initialization list of the constructor, and once set, it cannot change. Any attempt to set it to another value anywhere else in the code will result in a compiler error.
This means your constructor should look something like this:
Actor::Actor() :s_Total(0){}
static declares a member variable that is globally shared by all members of the class. You don't need an instance of your class to access it, but any changes you make to it will change it for any and all instances of that class that do exist.
If this is what you're trying to do, your code should look something like this:
// In the declaration (header file)class Actor{// blah blah blahpublic: static int s_Total;// blah blah blah};// in the definition (CPP file)int Actor::s_Total = 0;Actor::Actor(){ // no need to set s_Total here - it's already set // however if we need to change it, e.g for a reference count, we'd do something like this: ++s_Total;}
Note that in the second example, s_Total is essentially global to your entire application. Any piece of code can come along and modify it, so it wouldn't be a very safe reference count. If you only want your Actor class to modify it, make it private.