When I compile I just get In function `main': : undefined reference to

Hi I am very new at programming im trying to " Write a program to determine whether a date is valid in terms of days in that month." I thought I fixed all the bugs but now I just get
1
2
3
/tmp/ccethkpa.o(.text+0x11d): In function `main':
: undefined reference to `Date::Date()'
collect2: ld returned 1 exit status


i have no idea how to go about fixing this, or even what it means. If anyone could help me or point me in the right direction I would be very appreciative. Thanks!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include<iostream>

using namespace std;

        class Date
{
        private:
        int month, date, year;

        public:
        Date();

        Date( int mm, int dd, int yyyy)

{
        month = mm;
        date = dd;
        year = yyyy;
}


        int valid_Date( int month, int date, int year )
{
        switch( month )
{
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
        if( date >= 01 && date <= 31 )
{
        cout << "The date " << month << "/" << date << "/" << year << " is valid." << endl;
};

break;
case 2:

        if( date >= 01 && date <= 28 )
{
        cout << "The date " << month << "/" << date << "/" << year << " is valid." << endl;
}

        else if( date == 29 && (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)))
{
cout << "The date " << month << "/" << date << "/" << year << " is valid." << endl;
};

break;

case 4:
case 6:
case 9:
case 11:

        if( date >= 01 && date <= 30 )
{
        cout << "The date " << month << "/" << date << "/" << year << " is valid." << endl;
};

break;
default:
        cout << "The date " << month << "/" << date << "/" << year << " is not valid." << endl;
}
}
};


int main()
{
int mn, dt, yr;
Date test_date;

cout << "Enter month: ";
cin >> mn;

cout << "\nEnter date: ";
cin >> dt;

cout << "\nEnter year: ";
cin >> yr;
cout << endl;

test_date.valid_Date( mn, dt, yr );

return 0;
}


You declared but not defined the constructor of Date ( line 11 )
oh wow i cannot believe i missed that. thank you!
Topic archived. No new replies allowed.