Unresolved externals

Hi, I'm trying to write a program that has a Date class and a Julian class and converts the date to Julian but when I try to run it I keep getting an error that says unresolved externals.

//Name:Amanda Glavin
//Date:July 28, 2015
//Assignment: Converting to Julian Dates
//Lab: Lab 17

#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<iomanip>
#include<cmath>
using namespace std;

ofstream ofs("glavin_lab17_out.txt");

string message = "ENGR CIS 2485 Converting to Julian Dates.";
string fot = "----------------------------End of Data----------------------------";
string no = "EOF MESSAGE - ";
string more = "Amanda Glavin, ";
string hardcoding = "July 28 2015, ";
string of = "Lab 17 ";
string anything = "All Done.";
string fin = "Following Instructions";
string twt = "20%";
string ten = "10%";
string hun = "100%";
string scr = "your score is ----------";
string pts = "70";
string dit = "Does It Run";
string doc = "Correct Doc's";
string frm = "Format";
string str = "Structure";
string nam = "Correct files/names";
string tot = "Total Scores";

void header()
{
ofs << endl;
ofs << more << message << endl;
ofs << endl;

}

void footer()
{
ofs << endl;
ofs << fot << endl;
ofs << endl;
}

void grading()
{
ofs << endl;
ofs << fin << setw(8) << twt << setw(25) << scr << endl;
ofs << dit << setw(19) << twt << setw(25) << scr << endl;
ofs << doc << setw(17) << ten << setw(25) << scr << endl;
ofs << frm << setw(24) << ten << setw(25) << scr << endl;
ofs << str << setw(21) << twt << setw(25) << scr << endl;
ofs << nam << setw(11) << twt << setw(25) << scr << endl;
ofs << tot << setw(18) << hun << setw(25) << scr << endl;
ofs << of << setw(23) << pts << setw(26) << scr << endl;
ofs << endl;
}

void eofmsg()
{
ofs << endl;
ofs << no << more << hardcoding << of << anything << endl;

}

class Julian;

class Date
{
private:
int month, day;
long year;
public:
Date(int=1, int=31, long=2012);
operator Julian();
void getDate();
};

class Julian
{
private:
long p;
public:
Julian(long=0);
void showDate();
};

Date::operator Julian()
{
int MP, YP;
long T, JD;

if(month <= 2)
{
MP = 0;
YP = year - 1;
}
else
{
MP = double (.4 * month + 2.3);
YP = year;
}

T = int(YP/4) - int(YP/100) + int(YP/400);
JD = 365 * year + 31 * (month - 1) + day + T - MP;

return(Julian(JD));
}

void Julian:: showDate()
{
ofs << "Julian Date is " << p;
}

Julian::Julian(long jdate)
{
p = jdate;
}

void Date:: getDate()
{
cout << "Enter Month " << endl;
cin >> month;
cout << "Enter Day " << endl;
cin >> day;
cout << "Enter Year " << endl;
cin >> year;
}

int main()
{
header();
footer();
Date g;
Julian X;
ofs << "Gregorian Date: " << endl;
g.getDate();
X = Julian(g);
X.showDate();
grading();
eofmsg();
return 0;
}
Please wrap your code in the code tags (under Format)

Can you show us the complete error please?
You've been asked before: please use code tags to make your code easier to read:

http://www.cplusplus.com/articles/z13hAqkS/
You need to define the Date constructor
1
2
3
4
Date::Date(int m, int d, long y)
{
    // add your code here.
}

Topic archived. No new replies allowed.