I have class World in world.h:
class World
{
public:
static Ground* ground;
};
and in another class in a function I try to use the static variable ground like that:
#include "Node.h"
#include "World.h"
void Node::Foo()
{
Ground* ground = World::ground;
}
and also in world.cpp i have:
#include "stdafx.h"
#include "World.h"
static Ground* ground = new Ground(10, 10);
But i get the following errors:
- LNK2001 unresolved external symbol "public: static class Ground World::ground" (?ground@World@@2PAVGround@@A)
- LNK1120 1 unresolved externals