hello CollectiveMind,
Can/HowDo I assign static class member variabls in a class.constructor or class.setter function? If so, is there any special needs if the class.member variable is a pointer? I ask cause im getting the error below.
Quote:
error LNK2001: unresolved external symbol "public: static class HE_Node::HE_Graphics * HE_Node::graphicsPtr" (?graphicsPtr@HE_Node@@2PAVHE_Graphics@1@A) HE_Node.obj
Below (*.cpp) is the code that's giving me the error.
#include "StdAfx.h"
#include "HE_Node.h"
HE_Node::HE_Node(void)
{
//Can't get this static class member assignment to work!!!
graphicsPtr = 0; //Cant get this to werk. not sure how to access static data member here.
}
HE_Node::~HE_Node(void)
{
}
void HE_Node::setGraphicsPtr(HE_Graphics &c_graphicsPtr)
{
//Can't get this LINE to work EITHER!!!
graphicsPtr = &c_graphicsPtr;
}
...snippetEnd
Below (*.h) is where Ive created my STATIC pointer.
class HE_Node
{
public:
class HE_Graphics; //declare forward
static HE_Graphics *graphicsPtr;
//static void setGraphicsPtr(HE_Graphics &c_graphicsPtr); //TODO: Cant get this to work
...snippetEnd
vcpp 2008 in XP.sp1
intel mac