I have a class, let's call it Foo
Foo
does not compile when I include the following line in the class in the header.
static std::vector<UnvalidatedSocket*> unvalidatedSockets;
and the following line in the cpp.
Foo::unvalidatedSockets.push_back(new UnvalidatedSocket(ClientSocket));
when I take the static
keyword away it compiles just fine.
I checked for circular includes but there are none.
The error is LNK2001, unresolved external symbol
Why does this happen? Do static class members get included earlyer on?