So I have my header file with static members:
#ifndef PROFILE_MANAGER_H
#define PROFILE_MANAGER_H
#include <map>
#include <vector>
using namespace std;
using std::vector;
namespace Engine
{
class ProfileManager
{
private:
static map<const char*, vector<float>> profiles;
static map<const char*, vector<float>>::iterator it;
static pair<map<const char*, vector<float>>::iterator, bool> ret;
};
}
#endif
And in my cpp file i have the definitions:
#include "ProfileManager.h"
namespace Engine
{
map<const char*, vector<float>> ProfileManager::profiles;
map<const char*, vector<float>>::iterator ProfileManager::it;
pair<map<const char*, vector<float>>::iterator, bool> ProfileManager::ret;
}
The linker always complains about the static members being unresolved externals (LNK2001) even though I have defined them in the cpp file. Any ideas as to why?