Jump to content
  • Advertisement
Sign in to follow this  
Twinsen2

Link List error LNK2019: unresolved external symbol "public: void __thiscall Nod

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey all. Here is the full error message:
Ansi Link List error LNK2019: unresolved external symbol "public: void __thiscall Node::recuriteSoldier(class Soldier *,class Node *,class Node *,class Node *)" (?recuriteSoldier@Node@@QAEXPAVSoldier@@PAV1@11@Z) referenced in function _main
First off i have a simple question. When using the iterator in a linked list, say in a while loop do you have 2 initalize it 2 pHead all the time?? like before you run the loop do u have 2 make iterator the start again?? no2. lol I have this error message popping up and its really annoying.. I cant figure out y its comming up but i have narrowed it down to the line of code its comming from. Heres the LIne:
pIterator->recuriteSoldier(pSoldier, pHead, pIterator,pNode);
this is creating a new node and passing on some parameters 2 it. Here are the parameters initalized.
	Node *pNode = 0;
	Soldier * pSoldier = new Soldier();										// create a pointer and initalize it to 0, or NULL
	Node *pHead = new Node(pSoldier);					// creates a new Node and stores enough memory on the heap	
	Node *pIterator = pHead;
Please help, i had this error b4 and fixed it somehow. I have gone through msdn and that has confused me ever more.... ty

Share this post


Link to post
Share on other sites
Advertisement
The error message you posted is truncated. Please post the entire message so we can know what symbol the linker is complaining about.

In fact, it's because you have declared, but not implemented, the function it tells you about. But I can't guess which, you'll have to read the rest of the error message to find out.

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
The error message you posted is truncated. Please post the entire message so we can know what symbol the linker is complaining about.

In fact, it's because you have declared, but not implemented, the function it tells you about. But I can't guess which, you'll have to read the rest of the error message to find out.


yeah i thought of that but everything is declarded:
In the class:

void recuriteSoldier(Soldier *pSoldier,Node * pHead, Node *pIterator, Node *pNode);


Implementation its the cpp file:

void recuriteSoldier(Soldier *pSoldier,Node * pHead, Node *pIterator, Node *pNode)
{
//////////////////////////////////////////////////////////////////////////////////
//Method:
// Create tempory varibles that store users input and then pass these on to thier corrosponding functions
//Description:
// The current soldier that is being created needs to have its member data initalized
// to do this we need to create temporary local varibles that hold the users input and pass them
// onto thier corresponding functions in the soldier class
//////////////////////////////////////////
short int Kills = 0; // creates a short int for players kills
unsigned int Cash = 0;
string Name = ""; // string for NAme Name
string EmailAddress = ""; // string for email address

//////////////////////////////////////////////////////////////////////////////////
//Method:
// This is the create soldier part, all soldiers are initalized here and passed onto the Node and created as
// a linked list.
//Description:
// The user gets asked how many soldiers that they want to add this month, and a series of questions
// are displayed so that the user can enter in thier corresponding data.
//////////////////////////////////////////
begin:
system("cls"); // clears the screen, and clears the constructor message, that appears when creating pHead
cout << "*********************************************************************" << "\n";
cout << " ****************************************" << "\n";
cout << " *******************" << "\n";
cout << " *******" << "\n";
cout << "\t \t \t\ Welcome.. " << "\n"<< "\n";
cout << " Author: Gavan Walker"<< "\n"<< "\n";
cout << " Login:BIE05170" << "\n"<< "\n";
cout << "*/\* Welcome To The Soldier Recurite Screen */\*" << "\n";
cout << "*********************************************************************" << "\n";
int choicer = 1; // initalize choicer to 1, *i find its always good, and makes
// it easier to understand when you decalre something
// always initalize it to something, whether it be NULL or something else.



while(choicer == 1) // while the user still wants to recurite team members.
{
cout << "How many soldiers do you want to create?: "; // simple question that initalizes how many soldier are to be created
// this number is then passed along to the for loop and repeats
// the process for as many soldiers that they wanted to create.

cin >> choicer; // stores the users choice for amount of soldiers to recurite.
for(int counter = 1; counter <= choicer; counter ++) // a for loop that repeats the process how ever many times choicer has been initalized to
{

//////// Soldiers Input://////////
//Soldiers Name
cout << "\nPlease Input Soldier's Nickname: "; // counter is used to display what number the current soldier is.
cin >> Name; // stores Name in the tempory varible
cin.ignore(50,'\n'); // allows for a maximum of fifty characters to be entered and the space bar to be used, without stuffing up
// space bar is in a dos application the same as a return "\n", so if the user enters a space,without this
// then what ever is after the space gets passed on to the next varible, thus resulting
// in total chaos!!!!

pSoldier->SetNickame(Name); // Sets the current soldiers NickName, by passing on the tempory Name varible to it.
///////
//Soldiers Email Address

cout << "Please Input " << Name << "'s EmailAddress: "; //input soldiers email address, also the tempory varibles created
// come into use here as we actually state the name of the soldiers's email address
// to be created
// this greatly improves the user friendlyness. :/
cin >> EmailAddress; // stores in the temporary local varible
pSoldier->setEmailAddress(EmailAddress); // passes the local varible to be initalized as the soldiers email address.
///////

//Soldiers TotalAmount of Kils
cout << "Please Input " << Name << "'s Kills: "; // input soldiers kills question, temporary varible comes into play once again.
cin >> Kills; // Stores users input in the temporary varible.
pSoldier->SetKills(Kills); // passes temorary varible onto the soldiers setKills function.
//////

//Soldiers Rank:
pSoldier->setRank(Kills); //passes soldiers total kills onto setRankFunction
//////

//Solsiers Cash:
// If a soldier has already been given money.
// Ie the team paid the soldier to join thier team
cout << "Has " << Name << " been paid any money to join clan?\n";
cout << "If no money has been paid, please inset 0.\n";
cout << "If money has been paid then please enter in the amount: $";
cin >> Cash;

pSoldier->setCash(Cash);
//////Soldier creation in the list.

pSoldier = new Soldier(); // initalizes the pointer pSoldier's memory capacity
// to be able to store enough memory from the heap
// to accomadate a new Soldier object.
pNode = new Node(pSoldier); // passes the pointer soldier onto the Node
pHead->Insert(pNode);
system("CLS");
pHead->Display();
}
// End of the for loop.
cout << "Do you want to add more soldiers? \n\n";
cout << "Please press 1 to add more.\n";
cout << "Please press 2 to return to main menu.\n";
cin >> choicer;
if(choicer ==1)
{
goto begin;
}
else
{


}
}

}



and in my first post is how it is used???

ty 4 ne help

Share this post


Link to post
Share on other sites
You should implement it like this in your .cpp file:

void Node::recuriteSoldier(Soldier *pSoldier,Node * pHead, Node *pIterator, Node *pNode)
{
...
}

Share this post


Link to post
Share on other sites
Quote:
Original post by sphinx23
You should implement it like this in your .cpp file:

void Node::recuriteSoldier(Soldier *pSoldier,Node * pHead, Node *pIterator, Node *pNode)
{
...
}


AHAHHAHAHHAHAHHA man.......ur rigth.......bloody hell......such a simple mistake, has taken the last 4 hours of me trying to figure it out
dude......THANKZ.....

I always seem 2 miss out on the easy stupid errors but can fix much bigger problems.......thankz dude......

lol YES!!!!!!!!!!!!!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!