I'm new to this site and C++ programming. I'm making a text adventure game and am trying to link together two different story paths (.cpp files). I have referenced them in a header in order to link them, but for some reason when it doesn't like it:
The errors are:Code:int FirstPhase()
{
int Path1;
system("cls");
cout << "______________________________________________________________________________" << endl;
cout << "______________________________________________________________________________" << endl;
cout << "The night is young, you climb out of your treetop sanctuary into vegitation " << endl;
cout << "below. Preceding you, is a number of different paths. Which do you choose "<< endl;
cout << "______________________________________________________________________________" << endl;
cout <<" 1 - A dirt road leading out the forrest to the city." << endl;
cout <<" 2 - A small path leading to the dark lands." << endl;
cout <<" 3 - A path leading to what seems to be a small stream." << endl;
cout << "______________________________________________________________________________" << endl;
cin >> Path1;
if(Path1 == 1)
{
Beep(262,500);
cout << "_______________________Chapter One: New tomorrow_________________________" << endl;
cout << "The small road leading out of the forrest is.." << endl;
Path1 = PhaseOnePT2();
}
else if(Path1 == 2)
{
Beep(262,500);
cout << "----------------------Chapter One: New tomorrow----------------------" << endl;
cout << "Upon entering the dark path, you begin to hear many noises, none" << endl;
cout << "of which seem welcoming." << endl;
Sleep(3000);
//Path1 = SecondPhase();
}
else if(Path1 == 3)
{
Beep(262,500);
cout << "You walk down to the stream, following the sound of water, on arrival," << endl;
cout << "you realise that the rapids are far too fast for you to push against." << endl;
cout << "A freakrock slide closes the path you used to get to the river." << endl;
cout << "Only one path remains open, the path to the darklands." << endl;
Sleep(5000);
//Path1 = SecondPhase();
}
else
{
cout << "You are doing it wrong, warrior! Press either '1','2' or '3', nothing else!" << endl;
cout << "\n----------------------Press any key to continue----------------------" << endl;
// _getch();
}
system("cls");
return 0;
};
error LNK2019: unresolved external symbol "int __cdecl SecondPhase(void)" (?SecondPhase@@YAHXZ) referenced in function "int __cdecl FirstPhase(void)"
When i comment outthe error disappears. I don't know how to get it to work.Code:Path1 = SecondPhase();