Sign in to follow this  
gav86

unresolved external symbols

Recommended Posts

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[i].move(d);
	}
	return true;
}
PS: hope i got the tags right not sure how theyre done here on gdnet... Any & All help appreciated!!

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
*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

Share this post


Link to post
Share on other sites
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[i].move(d);
}
return true;
}

I think it's the problem here.

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this