The problem i that you missing the definition part (you only have the declaration part) and that leads to an incomplete type...
You can fix it like this...
class Animal
{
public:
static int ID;
};
int Animal:ID;
int main()
{
Animal::ID = 5;
printf("%d \n", Animal::ID);
return 0;
}
A much better expatiation is here:
static members - cppreference.com[
^]