unresolved external symbols

Started by
2 comments, last by programering 18 years, 6 months ago
well for starters unresolved external symbols are really starting to get to me - alot of the time they are really difficult for me to determine where the problem is. The current one that's getting me is this:
Quote:winmain.obj : error LNK2001: unresolved external symbol "public: bool __thiscall block::move(enum DIRECTION)" (?move@block@@QAE_NW4DIRECTION@@@Z)
Now I'm not sure if this line is referring to the place in my code where the function block::move() is actually called or where it is defined... Here is the line that calls it:
		if(testBlock->move(DOWN))
And here is its definition:
bool move(DIRECTION d)
{
	for(int i=0; i<4; i++)
	{
		squareArray.move(d);
	}
	return true;
}
PS: hope i got the tags right not sure how theyre done here on gdnet... Any & All help appreciated!!
Advertisement
I'm guessing the problem is you forgot to define the function as a member function. i.e.:

bool move(DIRECTION d)

should be:

bool block::move(DIRECTION d)
*hangs head in shame*

right you are. . right you are...
cant believe I didnt notice!!

oh well, thanks! Now I can get back to work at least..

I'm sure ill do the same thing 100 times more before I learn :P
Post all your code.

It seems that your declared it in a class named block

So to define the function in that block class, you write block:: between the return datatype declaration and the function name.

bool block::move(DIRECTION d)
{
for(int i=0; i<4; i++)
{
squareArray.move(d);
}
return true;
}

I think it's the problem here.

EDIT: sorry I wasn't fast enough, SiCrane already answeared

This topic is closed to new replies.

Advertisement