Sign in to follow this  
15Peter20

node creation for AI

Recommended Posts

15Peter20    144
im currently making a demo which demonstrates the implemenation of a breadth-first algorithem (cant spell that word -.-) and all was going well untill i cam upon this error: BreadthFirst.obj : error LNK2019: unresolved external symbol "struct coords * __cdecl createEast(struct coords *)" (?createEast@@YAPAUcoords@@PAU1@@Z) referenced in function _main it has appeared because i have created a function which takes the current node, and creates another one, north, east, south or west (just one, i have four functions, one for each) and returns the created node (i think this is wher eim going wrong) i have been playing around with the functions and this is the cloest i came for it to work. i know i could do it without functions, but i like to keep my code tidy without duplication. i know it cannot be a void type function, but maybe im going wrong here too. shown below is my code where i declare the function, and where i call it in my main:
// function protoypes
coords* createNorth(coords* currentNode);



// create north node
createNorth(currentNode);




// function that creates a node north by 1
coords* creatNorth(coords* currentNode)
{
	north->y = currentNode->y+1;
	north->x = currentNode->x;
	return north;	
}// end north()

any help on resolving this link error would be grand, thanks 15Peter20

Share this post


Link to post
Share on other sites
stonemetal    288
In the code you have posted I see function def and prototype for createNorth the error you are getting is can not find createEast so where is it? From the error you are getting you are calling it from main.

Share this post


Link to post
Share on other sites
Gage64    1235
That code doesn't call createEast(). Did you mean createNorth()?

Also, in the function implementation, you misspelled createNorth() (forgot the e before the N), which will cause a linker error if your calling createNorth() somewhere (because it doesn't have a definition).

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