This is really a continuation of my previous post regarding maps. I'm having problems using a map, my compiler g++ complains it cannot find a reference to a map decleration. I've had to write some test modules just to hightlight the problem and post them here :
#include "test.hpp"
int main(int argc, char** argv) {
Test* t = new Test();
t->TestMe();
delete(t);
return(0);
}
When I try to compile using g++ and the command 'g++ -o test main.cpp test.cpp
'
I get this compile error :
/tmp/ccgEDjJB.o: In function `Test::TestMe()':
test.cpp:(.text+0x69): undefined reference to `Test::tm'
collect2: ld returned 1 exit status
Just what is wrong ? I really cannot work this one out.. is it the way I'm declaring a map ?
I've declared tm as static, so I understand that means I can't instantiate it , or have I got that wrong.
I need it as static as I only want one copy of the map container for a class.. does it mean I can't use a map as static ? Seems a bit daft if that's the case.