Original Post
So I am trying to port some code from OpenGL written in C++ to another API keeping the C++ ness of it?
I have a class:
class CDrawBlock {
public:
static void DrawBlocks();
static void DrawBlock(blah,blah,blah);
private:
static NSprite blockSprites;
};
I then say from another class:
void GamePlay::idlePlay()
{
...
...
...
CDrawBlock::DrawBlocks();
}
This works fine up until from my main loop i say:
mainLoop()
{
GamePlay::idlePlay();
}
then i get a linker error:
Linker Error: Undefined : "CDrawBlock::blockSprites"
Referenced from "CDrawBlock::DrawBlocks" in DrawBlocks.cpp
I can get rid of this linker error by removing the static keyword from the drawblocks files...but then I get compile errors saying something bout illegal use of a non-static member.
So ya, I am stuck....I am guess its the way I cam calling the functions using the :: i.e.:
mainloop()
{
GamePlay::idelPlay();//if i dont make this call it compiles fine.
}
but this is how the code I am porting does it (am I wrong to assume that the :: makes it where you have no need to instantiate your objects beforehand?)
Thanks for any help here...
The less code I have to change the better.
Shane