I'm trying to create a public and static filed in a class called ResourceManager. But when trying to access the field even from inside the class it wont work. I'm getting this error message:
Error 1 error LNK2001: unresolved external symbol "public: static int ResourceManager::num" (?num@ResourceManager@@2HA)
Here's my code:
ResourceManager.h
Code:
class ResourceManager
{
public:
static int num;
static void loadContent();
};
ResourceManager.cpp
Code:
#include "ResourceManager.h"
void ResourceManager::loadContent()
{
num = 0;
}
I'm using Visual Studio 2012.