Consider the following code. Obviously the class is intended to get exported from a DLL - so there'll only ever be 1 x copy of some_var:-

class __declspec(dllexport) whatever
	static int some_var;
But I've occasionally seen this in code that was intended for a static lib - obviously without __declspec(dllexport) . The lib might be needed by multiple DLL's - so wouldn't they each have their own copy of some_var? And wouldn't that defeat the point of declaring as static? Or does this kinda thing get sorted out at runtime somehow?