# 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 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 on other sites

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 on other sites

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

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628338
• Total Posts
2982167

• 9
• 24
• 9
• 9
• 13