I'm fairly new to C++ and my professor gave me most of the code to start with. I'm supposed to write a program that uses the add_day(int n) function I wrote in Chrono.cpp.
There must be a problem with the Chrono::Date add_day(int n); line.
Here is the error:
hw4pr2.obj : error LNK2019: unresolved external symbol "class Chrono::Date __cdecl add_day(int)" (?add_day@@YA?AVDate@Chrono@@H@Z) referenced in function _main
//file hw4pr2.cpp
#include "Chrono.h"
#include "std_lib_facilities_3.h"
int main()
{
Chrono::Date date; //declaring our date variable from the Chrono.cpp file
Chrono::Date add_day(int n); //This is where the error has to be
cout << "Enter a date with the format (year,month,day):\n"; //asks user to input date in that format
while(cin >> date){ //input date
if(!cin) //bad input date
{
cout << "Wrong format. Closing...\n";
return 1;
}
++date; //increment the date with specifications to Chrono.cpp and Chrono.h
cout << "Tomorrow is: " << date << "\n"; //reads out the date
cout << "Two days from now is " << add_day(2);
}
keep_window_open();
return 0;
}