Public Group

# node creation for AI

This topic is 3741 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites
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 on other sites
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 on other sites
man i feel like a tit, just noticed i spelt the function name wrong :) it resolved it no errors thanks for pointing it out ^^

##### Share on other sites
i also had four different functions for north, south, east and west, and just copied one of the errors, thankyou people :) x

• 10
• 16
• 14
• 18
• 15