I am getting the above error on the lines marked here in the code. I have included my functions declarations as well. Can someon please tell what is wrong and what can I do to remedy it?
Code:
StackCities(StartCity, EndCity, DistanceMatrix,
PredecessorMatrix, st, Reverse);//<--------HERE
// Display the route - Start city to End city
//==========================================================
DispRoute(Reverse, st); // For testing
// Display the Intervening cities and the distances between
// them including the cumulative distances for the route
//==========================================================
DispItinerary(st, StartCity, EndCity, DistanceMatrix, Reverse);//<-----HERE
The function declarations:
Code:
void PrintPredChart(int cities, StringTable &st, TwoDIntArray &PredecessorArray);
void DispItinerary(StringTable &st, string StartCity, string EndCity, TwoDIntArray &DistanceMatrix, Stack &Reverse);
void DispRoute(Stack &Reverse, StringTable &st);
void InitMatrices(TwoDIntArray &DistanceMatrix, TwoDIntArray &PredecessorMatrix, int cities);
void getMapData(ifstream &in, StringTable &st, char * buf, TwoDIntArray &DistanceMatrix, TwoDIntArray &PredecessorMatrix);
void FloydWarshall(TwoDIntArray &DistanceMatrix, TwoDIntArray &PredecessorMatrix, int cities);
void StackCities(string StartCity, string EndCity, TwoDIntArray &DistanceMatrix, TwoDIntArray &PredecessorMatrix, StringTable &st, Stack &Reverse);
just in case:
Code:
int menuChoice;
string StartCity;
string EndCity;
string fileName;
//ifstream in;
cout<<"Welcome to J.A.C. P2 Assignment\n"
"\n"
"This program will find the shortest path\n"
"from One city to all other cities if there\n"
"is a connecting node, find the shortest path\n"
"between two cities or find the shortest\n"
"between three or more cities.\n"<<endl;
cout<<"Please make a choice of what you would like to do:\n"<<endl;
cout<<" 1------> Shortest Path between 2 cities.\n"
" 2------> Shortest Path between 3 or more cities.\n"
" 3------> Shortest Path from 1 city to all.\n"
" 9------> Take your ball and go home!\n"<<endl;
cout<<"Waiting on you: "; cin>>menuChoice;
switch (menuChoice) {
case 1:
cout<<"Enter the starting city: ";
cin>>StartCity;
cout<<"\nEnter the ending city: ";
cin>> EndCity;
cout<<"\nEnter the name of the file: ";
cin>> fileName;
break;
Thank You.
Code:
obj\Debug\main.o||In function `main':|
C:\Users\Documents\C++ Files\short\main.cpp|139|undefined reference to `StackCities(std::string, std::string, TwoDIntArray&, TwoDIntArray&, StringTable&, Stack&)'|
C:\Users\Documents\C++ Files\short\main.cpp|148|undefined reference to `DispItinerary(StringTable&, std::string, std::string, TwoDIntArray&, Stack&)'|
||=== Build finished: 2 errors, 0 warnings ===|