Another C++ N00B Begging For Help

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2006
Posts: 2
Reputation: The Tao Of Bill is an unknown quantity at this point 
Solved Threads: 0
The Tao Of Bill The Tao Of Bill is offline Offline
Newbie Poster

Another C++ N00B Begging For Help

 
0
  #1
Oct 17th, 2006
You guys have got to be sick of these C++ noobs coming in here asking for homework help but thats what Im going to have to do because I am totally lost....I was following pretty good till we got to overloading and passing things polymorphicly

Anyway the point of this homework assignment is to take an already created payrole program that sends information up polymorphically depending on the position of the employee. We are supposed to modify it to contain a birthdate variable in the employee class and have a date passed from the main program to the employee class for each employee and if this month is their birthday it's supposed to give them a $100 bonus. Well I can't even get it to pass the date all the way to employee without getting some weird linking error. I have no idea how to fix them. I hear they are caused when I have a function that doesn't get called or something like that...not sure if thats what I'm doing or not but here is the code im working with. I apologize in advanced for how much im going to give you but being that the complier doesn't tell me where exactly im doing something wrong I have to post everything to be sure i can get a straight answer...


HEADERS
BasePlusCommissionEmployee.h

  1. #ifndef BASEPLUS_H
  2. #define BASEPLUS_H
  3.  
  4. #include "CommissionEmployee.h" // CommissionEmployee class definition
  5. #include "Date.h"
  6.  
  7. class BasePlusCommissionEmployee : public CommissionEmployee
  8. {
  9. public:
  10. BasePlusCommissionEmployee( const string &, const string &,
  11. const string &, Date & , double = 0.0, double = 0.0, double = 0.0 );// add date values here
  12.  
  13. void setBaseSalary( double ); // set base salary
  14. double getBaseSalary() const; // return base salary
  15.  
  16. // keyword virtual signals intent to override
  17. virtual double earnings() const; // calculate earnings
  18. virtual void print() const; // print BasePlusCommissionEmployee object
  19. private:
  20. double baseSalary; // base salary per week
  21. }; // end class BasePlusCommissionEmployee
  22.  
  23. #endif // BASEPLUS_H
CommissionEmployee.h
  1. // Fig. 13.19: CommissionEmployee.h
  2. // CommissionEmployee class derived from Employee.
  3. #ifndef COMMISSION_H
  4. #define COMMISSION_H
  5.  
  6. #include "Employee.h" // Employee class definition
  7.  
  8. class CommissionEmployee : public Employee
  9. {
  10. public:
  11. CommissionEmployee( const string &, const string &,
  12. const string &, Date &, double = 0.0, double = 0.0 );// add date values here
  13.  
  14. void setCommissionRate( double ); // set commission rate
  15. double getCommissionRate() const; // return commission rate
  16.  
  17. void setGrossSales( double ); // set gross sales amount
  18. double getGrossSales() const; // return gross sales amount
  19.  
  20. // keyword virtual signals intent to override
  21. virtual double earnings() const; // calculate earnings
  22. virtual void print() const; // print CommissionEmployee object
  23. private:
  24. double grossSales; // gross weekly sales
  25. double commissionRate; // commission percentage
  26. }; // end class CommissionEmployee
  27.  
  28. #endif // COMMISSION_H
Date.h
  1. // Fig. 11.12: Date.h
  2. // Date class definition.
  3. #ifndef DATE_H
  4. #define DATE_H
  5.  
  6. #include <iostream>
  7. using std::ostream;
  8.  
  9. class Date
  10. {
  11. friend ostream &operator<<( ostream &, const Date & );
  12. public:
  13. Date( int m = 1, int d = 1, int y = 1900 ); // default constructor
  14. Date( Date &);
  15. void setDate( int, int, int ); // set month, day, year
  16. Date &operator++(); // prefix increment operator
  17. Date operator++( int ); // postfix increment operator
  18. const Date &operator+=( int ); // add days, modify object
  19. bool leapYear( int ) const; // is date in a leap year?
  20. bool endOfMonth( int ) const; // is date at the end of month?
  21. private:
  22. int month;
  23. int day;
  24. int year;
  25.  
  26. static const int days[]; // array of days per month
  27. void helpIncrement(); // utility function for incrementing date
  28. }; // end class Date
  29.  
  30. #endif
Employee.h
  1. // Fig. 13.13: Employee.h
  2. // Employee abstract base class.
  3. #ifndef EMPLOYEE_H
  4. #define EMPLOYEE_H
  5.  
  6. #include <string> // C++ standard string class
  7. using std::string;
  8.  
  9. #include "Date.h"
  10. class Employee
  11. {
  12. public:
  13. Employee( const string &, const string &, const string &, Date & );
  14.  
  15. void setFirstName( const string & ); // set first name
  16. string getFirstName() const; // return first name
  17.  
  18. void setLastName( const string & ); // set last name
  19. string getLastName() const; // return last name
  20.  
  21. void setSocialSecurityNumber( const string & ); // set SSN
  22. string getSocialSecurityNumber() const; // return SSN
  23.  
  24. void setBirthDate(Date &);
  25.  
  26. // pure virtual function makes Employee abstract base class
  27. virtual double earnings() const = 0; // pure virtual
  28. virtual void print() const; // virtual
  29. private:
  30. string firstName;
  31. string lastName;
  32. string socialSecurityNumber;
  33. Date &birthDate;
  34. }; // end class Employee
  35.  
  36. #endif // EMPLOYEE_H
HourlyEmployee.h
  1. // Fig. 13.17: HourlyEmployee.h
  2. // HourlyEmployee class definition.
  3. #ifndef HOURLY_H
  4. #define HOURLY_H
  5.  
  6. #include "Employee.h" // Employee class definition
  7.  
  8. class HourlyEmployee : public Employee
  9. {
  10. public:
  11. HourlyEmployee( const string &, const string &,
  12. const string &, Date &, double = 0.0, double = 0.0);// add date values here
  13.  
  14. void setWage( double ); // set hourly wage
  15. double getWage() const; // return hourly wage
  16.  
  17. void setHours( double ); // set hours worked
  18. double getHours() const; // return hours worked
  19.  
  20. // keyword virtual signals intent to override
  21. virtual double earnings() const; // calculate earnings
  22. virtual void print() const; // print HourlyEmployee object
  23. private:
  24. double wage; // wage per hour
  25. double hours; // hours worked for week
  26. }; // end class HourlyEmployee
  27.  
  28. #endif // HOURLY_H
SalariedEmployee.h
  1. // Fig. 13.15: SalariedEmployee.h
  2. // SalariedEmployee class derived from Employee.
  3. #ifndef SALARIED_H
  4. #define SALARIED_H
  5.  
  6. #include "Employee.h" // Employee class definition
  7.  
  8. #include <string> // C++ standard string class
  9. using std::string;
  10. class SalariedEmployee : public Employee
  11. {
  12. public:
  13. SalariedEmployee( const string &, const string &,
  14. const string &, Date &, double = 0.0);// add date values here
  15.  
  16. void setWeeklySalary( double ); // set weekly salary
  17. double getWeeklySalary() const; // return weekly salary
  18.  
  19. // keyword virtual signals intent to override
  20. virtual double earnings() const; // calculate earnings
  21. virtual void print() const; // print SalariedEmployee object
  22. private:
  23. double weeklySalary; // salary per week
  24. }; // end class SalariedEmployee
  25.  
  26. #endif // SALARIED_H
SOURCE FILES

BasePlusCommissionEmployee.cpp
  1. // Fig. 13.22: BasePlusCommissionEmployee.cpp
  2. // BasePlusCommissionEmployee member-function definitions.
  3. #include <iostream>
  4. using std::cout;
  5.  
  6. // BasePlusCommissionEmployee class definition
  7. #include "BasePlusCommissionEmployee.h"
  8.  
  9. // constructor
  10. BasePlusCommissionEmployee::BasePlusCommissionEmployee(
  11. const string &first, const string &last, const string &ssn, Date &d,
  12. double sales, double rate, double salary )// add date values here
  13. : CommissionEmployee( first, last, ssn, d, sales, rate )
  14. {
  15. setBaseSalary( salary ); // validate and store base salary
  16. } // end BasePlusCommissionEmployee constructor
  17.  
  18. // set base salary
  19. void BasePlusCommissionEmployee::setBaseSalary( double salary )
  20. {
  21. baseSalary = ( ( salary < 0.0 ) ? 0.0 : salary );
  22. } // end function setBaseSalary
  23.  
  24. // return base salary
  25. double BasePlusCommissionEmployee::getBaseSalary() const
  26. {
  27. return baseSalary;
  28. } // end function getBaseSalary
  29.  
  30. // calculate earnings;
  31. // override pure virtual function earnings in Employee
  32. double BasePlusCommissionEmployee::earnings() const
  33. {
  34. return getBaseSalary() + CommissionEmployee::earnings();
  35. } // end function earnings
  36.  
  37. // print BasePlusCommissionEmployee's information
  38. void BasePlusCommissionEmployee::print() const
  39. {
  40. cout << "base-salaried ";
  41. CommissionEmployee::print(); // code reuse
  42. cout << "; base salary: " << getBaseSalary();
  43. } // end function print
CommissionEmployee.h
  1. // Fig. 13.19: CommissionEmployee.h
  2. // CommissionEmployee class derived from Employee.
  3. #ifndef COMMISSION_H
  4. #define COMMISSION_H
  5.  
  6. #include "Employee.h" // Employee class definition
  7.  
  8. class CommissionEmployee : public Employee
  9. {
  10. public:
  11. CommissionEmployee( const string &, const string &,
  12. const string &, Date &, double = 0.0, double = 0.0 );// add date values here
  13.  
  14. void setCommissionRate( double ); // set commission rate
  15. double getCommissionRate() const; // return commission rate
  16.  
  17. void setGrossSales( double ); // set gross sales amount
  18. double getGrossSales() const; // return gross sales amount
  19.  
  20. // keyword virtual signals intent to override
  21. virtual double earnings() const; // calculate earnings
  22. virtual void print() const; // print CommissionEmployee object
  23. private:
  24. double grossSales; // gross weekly sales
  25. double commissionRate; // commission percentage
  26. }; // end class CommissionEmployee
  27.  
  28. #endif // COMMISSION_H
Date.cpp
  1. // Fig. 11.13: Date.cpp
  2. // Date class member-function definitions.
  3. #include <iostream>
  4. #include "Date.h"
  5.  
  6. // initialize static member at file scope; one classwide copy
  7. const int Date::days[] =
  8. { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
  9.  
  10. // Date constructor
  11. Date::Date( int m, int d, int y )
  12. {
  13. setDate( m, d, y );
  14. } // end Date constructor
  15.  
  16.  
  17. // set month, day and year
  18. void Date::setDate( int mm, int dd, int yy )
  19. {
  20. month = ( mm >= 1 && mm <= 12 ) ? mm : 1;
  21. year = ( yy >= 1900 && yy <= 2100 ) ? yy : 1900;
  22.  
  23. // test for a leap year
  24. if ( month == 2 && leapYear( year ) )
  25. day = ( dd >= 1 && dd <= 29 ) ? dd : 1;
  26. else
  27. day = ( dd >= 1 && dd <= days[ month ] ) ? dd : 1;
  28. } // end function setDate
  29.  
  30. // overloaded prefix increment operator
  31. Date &Date::operator++()
  32. {
  33. helpIncrement(); // increment date
  34. return *this; // reference return to create an lvalue
  35. } // end function operator++
  36.  
  37. // overloaded postfix increment operator; note that the
  38. // dummy integer parameter does not have a parameter name
  39. Date Date::operator++( int )
  40. {
  41. Date temp = *this; // hold current state of object
  42. helpIncrement();
  43.  
  44. // return unincremented, saved, temporary object
  45. return temp; // value return; not a reference return
  46. } // end function operator++
  47.  
  48. // add specified number of days to date
  49. const Date &Date::operator+=( int additionalDays )
  50. {
  51. for ( int i = 0; i < additionalDays; i++ )
  52. helpIncrement();
  53.  
  54. return *this; // enables cascading
  55. } // end function operator+=
  56.  
  57. // if the year is a leap year, return true; otherwise, return false
  58. bool Date::leapYear( int testYear ) const
  59. {
  60. if ( testYear % 400 == 0 ||
  61. ( testYear % 100 != 0 && testYear % 4 == 0 ) )
  62. return true; // a leap year
  63. else
  64. return false; // not a leap year
  65. } // end function leapYear
  66.  
  67. // determine whether the day is the last day of the month
  68. bool Date::endOfMonth( int testDay ) const
  69. {
  70. if ( month == 2 && leapYear( year ) )
  71. return testDay == 29; // last day of Feb. in leap year
  72. else
  73. return testDay == days[ month ];
  74. } // end function endOfMonth
  75.  
  76. // function to help increment the date
  77. void Date::helpIncrement()
  78. {
  79. // day is not end of month
  80. if ( !endOfMonth( day ) )
  81. day++; // increment day
  82. else
  83. if ( month < 12 ) // day is end of month and month < 12
  84. {
  85. month++; // increment month
  86. day = 1; // first day of new month
  87. } // end if
  88. else // last day of year
  89. {
  90. year++; // increment year
  91. month = 1; // first month of new year
  92. day = 1; // first day of new month
  93. } // end else
  94. } // end function helpIncrement
  95.  
  96. // overloaded output operator
  97. ostream &operator<<( ostream &output, const Date &d )
  98. {
  99. static char *monthName[ 13 ] = { "", "January", "February",
  100. "March", "April", "May", "June", "July", "August",
  101. "September", "October", "November", "December" };
  102. output << monthName[ d.month ] << ' ' << d.day << ", " << d.year;
  103. return output; // enables cascading
  104. } // end function operator<<
Employee.cpp
  1. // Fig. 13.14: Employee.cpp
  2. // Abstract-base-class Employee member-function definitions.
  3. // Note: No definitions are given for pure virtual functions.
  4. #include <iostream>
  5. using std::cout;
  6.  
  7. #include "Employee.h" // Employee class definition
  8. #include "Date.h"
  9.  
  10. // constructor
  11. Employee::Employee( const string &first, const string &last,
  12. const string &ssn, Date &d )
  13. : firstName( first ), lastName( last ), socialSecurityNumber( ssn ), birthDate( d )
  14. {
  15.  
  16. // empty body
  17. } // end Employee constructor
  18.  
  19. // set first name
  20. void Employee::setFirstName( const string &first )
  21. {
  22. firstName = first;
  23. } // end function setFirstName
  24.  
  25. // return first name
  26. string Employee::getFirstName() const
  27. {
  28. return firstName;
  29. } // end function getFirstName
  30.  
  31. // set last name
  32. void Employee::setLastName( const string &last )
  33. {
  34. lastName = last;
  35. } // end function setLastName
  36.  
  37. // return last name
  38. string Employee::getLastName() const
  39. {
  40. return lastName;
  41. } // end function getLastName
  42.  
  43. // set social security number
  44. void Employee::setSocialSecurityNumber( const string &ssn )
  45. {
  46. socialSecurityNumber = ssn; // should validate
  47. } // end function setSocialSecurityNumber
  48.  
  49. // return social security number
  50. string Employee::getSocialSecurityNumber() const
  51. {
  52. return socialSecurityNumber;
  53. } // end function getSocialSecurityNumber
  54.  
  55. void Employee::setBirthDate(Date &d)
  56. {
  57. birthDate = d;
  58. };
  59.  
  60. // print Employee's information (virtual, but not pure virtual)
  61. void Employee::print() const
  62. {
  63. cout << getFirstName() << ' ' << getLastName()
  64. << "\nsocial security number: " << getSocialSecurityNumber()
  65. << "\nBirthday: " << &birthDate;
  66. } // end function print
HourlyEmployee.cpp
  1. // Fig. 13.18: HourlyEmployee.cpp
  2. // HourlyEmployee class member-function definitions.
  3. #include <iostream>
  4. using std::cout;
  5.  
  6. #include "HourlyEmployee.h" // HourlyEmployee class definition
  7. #include "Date.h"
  8.  
  9. // constructor
  10. HourlyEmployee::HourlyEmployee( const string &first, const string &last,
  11. const string &ssn, Date &d, double hourlyWage, double hoursWorked )// add date values here
  12. : Employee( first, last, ssn, d )
  13. {
  14. setWage( hourlyWage ); // validate hourly wage
  15. setHours( hoursWorked ); // validate hours worked
  16. } // end HourlyEmployee constructor
  17.  
  18. // set wage
  19. void HourlyEmployee::setWage( double hourlyWage )
  20. {
  21. wage = ( hourlyWage < 0.0 ? 0.0 : hourlyWage );
  22. } // end function setWage
  23.  
  24. // return wage
  25. double HourlyEmployee::getWage() const
  26. {
  27. return wage;
  28. } // end function getWage
  29.  
  30. // set hours worked
  31. void HourlyEmployee::setHours( double hoursWorked )
  32. {
  33. hours = ( ( ( hoursWorked >= 0.0 ) && ( hoursWorked <= 168.0 ) ) ?
  34. hoursWorked : 0.0 );
  35. } // end function setHours
  36.  
  37. // return hours worked
  38. double HourlyEmployee::getHours() const
  39. {
  40. return hours;
  41. } // end function getHours
  42.  
  43. // calculate earnings;
  44. // override pure virtual function earnings in Employee
  45. double HourlyEmployee::earnings() const
  46. {
  47. if ( getHours() <= 40 ) // no overtime
  48. return getWage() * getHours();
  49. else
  50. return 40 * getWage() + ( ( getHours() - 40 ) * getWage() * 1.5 );
  51. } // end function earnings
  52.  
  53. // print HourlyEmployee's information
  54. void HourlyEmployee::print() const
  55. {
  56. cout << "hourly employee: ";
  57. Employee::print(); // code reuse
  58. cout << "\nhourly wage: " << getWage() <<
  59. "; hours worked: " << getHours();
  60. } // end function print
SalariedEmployee.cpp
  1. // Fig. 13.16: SalariedEmployee.cpp
  2. // SalariedEmployee class member-function definitions.
  3. #include <iostream>
  4. using std::cout;
  5.  
  6. #include "SalariedEmployee.h" // SalariedEmployee class definition
  7. #include "Date.h"
  8.  
  9. // constructor
  10. SalariedEmployee::SalariedEmployee( const string &first,
  11. const string &last, const string &ssn, Date &d, double salary )// add date values here
  12. : Employee( first, last, ssn, d )
  13. {
  14. setWeeklySalary( salary );
  15. } // end SalariedEmployee constructor
  16.  
  17. // set salary
  18. void SalariedEmployee::setWeeklySalary( double salary )
  19. {
  20. weeklySalary = ( salary < 0.0 ) ? 0.0 : salary;
  21. } // end function setWeeklySalary
  22.  
  23. // return salary
  24. double SalariedEmployee::getWeeklySalary() const
  25. {
  26. return weeklySalary;
  27. } // end function getWeeklySalary
  28.  
  29. // calculate earnings;
  30. // override pure virtual function earnings in Employee
  31. double SalariedEmployee::earnings() const
  32. {
  33. return getWeeklySalary();
  34. } // end function earnings
  35.  
  36. // print SalariedEmployee's information
  37. void SalariedEmployee::print() const
  38. {
  39. cout << "salaried employee: ";
  40. Employee::print(); // reuse abstract base-class print function
  41. cout << "\nweekly salary: " << getWeeklySalary();
  42. } // end function print
fig13_23.cpp
  1. // Fig. 13.23: fig13_23.cpp
  2. // Processing Employee derived-class objects individually
  3. // and polymorphically using dynamic binding.
  4. #include <iostream>
  5. using std::cout;
  6. using std::endl;
  7. using std::fixed;
  8.  
  9. #include <iomanip>
  10. using std::setprecision;
  11.  
  12. #include <vector>
  13. using std::vector;
  14.  
  15. // include definitions of classes in Employee hierarchy
  16. #include "Employee.h"
  17. #include "SalariedEmployee.h"
  18. #include "HourlyEmployee.h"
  19. #include "CommissionEmployee.h"
  20. #include "BasePlusCommissionEmployee.h"
  21. #include "Date.h"
  22.  
  23. void virtualViaPointer( const Employee * const ); // prototype
  24. void virtualViaReference( const Employee & ); // prototype
  25.  
  26. int main()
  27. {
  28. Date JSmith(2,14,1976);
  29. Date KPrice(12,16,1981);
  30. Date SJones(11,06,1987);
  31. Date BLewis(10,10,1981);
  32.  
  33. Date currentDate(10,3,2006);
  34. // set floating-point output formatting
  35. cout << fixed << setprecision( 2 );
  36.  
  37. // create derived-class objects
  38. SalariedEmployee salariedEmployee(
  39. "John", "Smith", "111-11-1111", JSmith, 800 );// add date values here
  40. HourlyEmployee hourlyEmployee(
  41. "Karen", "Price", "222-22-2222", KPrice, 16.75, 40 );// add date values here
  42. CommissionEmployee commissionEmployee(
  43. "Sue", "Jones", "333-33-3333", SJones, 10000, .06 );// add date values here
  44. BasePlusCommissionEmployee basePlusCommissionEmployee(
  45. "Bob", "Lewis", "444-44-4444", BLewis, 5000, .04, 300 );// add date values here
  46.  
  47. cout << JSmith << "\n\n"
  48. << KPrice << "\n\n"
  49. << SJones << "\n\n"
  50. << BLewis;
  51.  
  52. // output each Employee’s information and earnings using static binding
  53. salariedEmployee.print();
  54. cout << "\nearned $" << salariedEmployee.earnings() << "\n\n";
  55. hourlyEmployee.print();
  56. cout << "\nearned $" << hourlyEmployee.earnings() << "\n\n";
  57. commissionEmployee.print();
  58. cout << "\nearned $" << commissionEmployee.earnings() << "\n\n";
  59. basePlusCommissionEmployee.print();
  60. cout << "\nearned $" << basePlusCommissionEmployee.earnings()
  61. << "\n\n";
  62.  
  63. // create vector of four base-class pointers
  64. vector < Employee * > employees( 4 );
  65.  
  66. // initialize vector with Employees
  67. employees[ 0 ] = &salariedEmployee;
  68. employees[ 1 ] = &hourlyEmployee;
  69. employees[ 2 ] = &commissionEmployee;
  70. employees[ 3 ] = &basePlusCommissionEmployee;
  71.  
  72. cout << "Employees processed polymorphically via dynamic binding:\n\n";
  73.  
  74. // call virtualViaPointer to print each Employee's information
  75. // and earnings using dynamic binding
  76. cout << "Virtual function calls made off base-class pointers:\n\n";
  77.  
  78. for ( size_t i = 0; i < employees.size(); i++ )
  79. virtualViaPointer( employees[ i ] );
  80.  
  81. // call virtualViaReference to print each Employee's information
  82. // and earnings using dynamic binding
  83. cout << "Virtual function calls made off base-class references:\n\n";
  84.  
  85. for ( size_t i = 0; i < employees.size(); i++ )
  86. virtualViaReference( *employees[ i ] ); // note dereferencing
  87.  
  88. return 0;
  89. } // end main
  90.  
  91. // call Employee virtual functions print and earnings off a
  92. // base-class pointer using dynamic binding
  93. void virtualViaPointer( const Employee * const baseClassPtr )
  94. {
  95. baseClassPtr->print();
  96. cout << "\nearned $" << baseClassPtr->earnings() << "\n\n";
  97. } // end function virtualViaPointer
  98.  
  99. // call Employee virtual functions print and earnings off a
  100. // base-class reference using dynamic binding
  101. void virtualViaReference( const Employee &baseClassRef )
  102. {
  103. baseClassRef.print();
  104. cout << "\nearned $" << baseClassRef.earnings() << "\n\n";
  105. } // end function virtualViaReference
Again i'm sorry for the monsterious amount of code but I didn't know what else to do. I'm falling way behind in this class and I'm getting really frustrated. I'm usually good at understanding programs...

Anyway here is the build log when i try to compile that:

  1. ------ Build started: Project: homework13_12, Configuration: Debug Win32 ------
  2. Compiling...
  3. SalariedEmployee.cpp
  4. HourlyEmployee.cpp
  5. fig13_23.cpp
  6. Employee.cpp
  7. Date.cpp
  8. CommissionEmployee.cpp
  9. BasePlusCommissionEmployee.cpp
  10. Generating Code...
  11. Linking...
  12. Date.obj : error LNK2028: unresolved token (0A00028C) "public: __thiscall Date::Date(class Date &)" (??0Date@@$$FQAE@AAV0@@Z) referenced in function "public: class Date __thiscall Date::operator++(int)" (??EDate@@$$FQAE?AV0@H@Z)
  13. Date.obj : error LNK2019: unresolved external symbol "public: __thiscall Date::Date(class Date &)" (??0Date@@$$FQAE@AAV0@@Z) referenced in function "public: class Date __thiscall Date::operator++(int)" (??EDate@@$$FQAE?AV0@H@Z)
  14. G:\C++\homework\homework13_12_2\Debug\homework13_12.exe : fatal error LNK1120: 2 unresolved externals
  15. Build log was saved at "file://g:\C++\homework\homework13_12_2\homework13_12_2\Debug\BuildLog.htm"
  16. homework13_12 - 3 error(s), 0 warning(s)
  17. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Please help if you can.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,343
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1458
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Another C++ N00B Begging For Help

 
0
  #2
Oct 17th, 2006
>> Date.obj : error LNK2028: unresolved token (0A00028C) "public: __thiscall Date::Date(class Date &)" (??0Date@@$$FQAE@AAV0@@Z)

The above error (and similar other ones) is telling you that you forgot to code one of the Date constructors. If you look in Date.h you will find that it has two constructurs -- but in Date.cpp only one of them was coded. You need to implement the missing one.
Last edited by Ancient Dragon; Oct 17th, 2006 at 3:22 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2
Reputation: The Tao Of Bill is an unknown quantity at this point 
Solved Threads: 0
The Tao Of Bill The Tao Of Bill is offline Offline
Newbie Poster

Re: Another C++ N00B Begging For Help

 
0
  #3
Oct 17th, 2006
Wow that could not have been more simple! *smacks head* thanks a lot! Now I just gotta get the rest of the program working...
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Another C++ N00B Begging For Help

 
0
  #4
Oct 17th, 2006
Ha ha, how many header files you got there kiddo. Looks a bit like overkill to me.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC