My question could be silly but I am having following problem.
Following piece of code works just fine. I have list that is global or local and can instantiate and push values correctly.
class THistory
{
public:
UInt32 index;
UInt32 navToID;
};
//Works Fine
class ML{
public:
static THistory *hist2;
};
main.cpp;
ML::hist2 = new THistory[HISTORY_BUFFER_SIZE];//global
std::list<THistory> histList;//global
histList.push_back(ML::hist2[0]);//inside main()
Problem starts when I move the list inside a class.
//Problem
class ML{
public:
static THistory *hist2;
static std::list<THistory> histList; //replace global list and put it inside ML class as static
}
main.cpp;
ML::hist2 = new THistory[HISTORY_BUFFER_SIZE];//global as before
////// Where to initialize the list?
ML::histList.push_back(CoreML::hist2[0]); //inside main()
//LINK Error Undefined symbol
error LNK2001: unresolved external symbol "public: static class std::list > CoreML::histList" (?histList@CoreML@@2V?$list@VTHistory@@V?$allocator@VTHistory@@@std@@@std@@A)
I dont know how to initialize the list. any pointers will be helpful.