Unresolved external symbol

Hey guys, I got some help from you to fix my program. I just finished it but I'm getting a bunch of unresolved external symbol error. Anyone know what's going on? My professor provided us with the header files, the class just had to write the source code. Any help is really appreciated.
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
  #include <iostream>
#include <string>
#include "ccc_empl.h"
#include "ccc_time.h"

using namespace std;


// main function ***********************************************************

int main ()
{
    Time timeOne = Time();
	Time timeTwo = Time();
	int hours;
	int minutes;
	int seconds;
	Employee employeeInfo[3];
	Employee employee1;
	Employee employee2;
	Employee employee3;
	string name;
	double salary;

	employeeInfo[0] = employee1;
	employeeInfo[1] = employee2;
	employeeInfo[2] = employee3;


	cout << "Please enter your choice for the hour: ";
	cin >> hours;

	while(hours > 24)
	{
		cout << "Please enter a number less than 24: " << endl;
		cin >> hours;
	}

	cout << "Please enter your choice for the minute: ";
	cin >> minutes;

	while(minutes > 60)
	{
		cout << "Please enter a number less than 60: " << endl;
		cin >> minutes;
	}


	cout << "Please enter your choice for the second: ";
	cin >> seconds;

	while(seconds > 60)
	{
		cout << "Please enter a number less than 60: ";
		cin >> seconds;
	}

	
	timeTwo = Time(hours, minutes, seconds);

	cout << "Current time: " << timeOne.get_hours() << " : " << timeOne.get_minutes() 
		<< " : " << timeOne.get_seconds() << endl;

	cout << "The time you provided: " << timeTwo.get_hours() << " : " << timeTwo.get_minutes() <<
		" : " << timeTwo.get_seconds() << endl;

	cout << "The amount of time between Current time and your time is : " << endl;
	int h = timeOne.get_hours() - timeTwo.get_hours();
	if(h < 0) 
	{
		h = 10;
	}
	cout << h << " : ";

	int m = timeOne.get_minutes() - timeTwo.get_minutes();
	if(m < 0)
	{
		m = 30;
	}
	cout << m << " : ";

	int s = timeOne.get_seconds() - timeTwo.get_seconds();
	if(s < 0)
	{
		s = 15;
	}
	cout << s << endl;

	
	for (int i = 0; i < 3; i++)
	{
		cout << "Please enter a name: " << endl;
		cin >> name;
		cout << "Please enter a salary: " << endl;
		cin >> salary;
		employeeInfo[i] = Employee (name, salary);
	}

	for (int i = 0; i < 3; i++)
	{
		salary = employeeInfo[i].get_salary();
		salary = salary * .15 + salary;
		employeeInfo[i].set_salary(salary);
	}





	
	// End of program statements
	cout << "Please press enter once or twice to continue...";
	cin.ignore().get();    			// hold console window open
	return EXIT_SUCCESS;           	// successful termination
    
}
// end main() **************************************************************


This is the ccc_time.h file:
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
#ifndef CCC_TIME_H
#define CCC_TIME_H

/**
   A class that describes a time of day
   (between 00:00:00 and 23:59:59)
*/
class Time
{
public:
   /**
      Constructs a time of day.
      @param hour the hours
      @param min the minutes
      @param sec the seconds
   */
   Time(int hour, int min, int sec);
   /**
      Constructs a Time object that is set to 
      the time at which the constructor executes.
   */
   Time();

   /**
      Gets the hours of this time.
      @return the hours
   */
   int get_hours() const;
   /**
      Gets the minutes of this time.
      @return the minutes
   */
   int get_minutes() const;
   /**
      Gets the seconds of this time.
      @return the seconds
   */
   int get_seconds() const;

   /**
      Computes the seconds between this time and another.
      @param t the other time
      @return the number of seconds between this time and t
   */
   int seconds_from(Time t) const;
   /**
      Adds a number of seconds to this time.
      @param s the number of seconds to add
   */
   void add_seconds(int s);

private:
   int time_in_secs;
};

#endif 


And this is the ccc_empl.h file
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
#ifndef CCC_EMPL_H
#define CCC_EMPL_H

#include <string>

using namespace std;

/**
   A basic employee class that is used in many examples
   in the book "Computing Concepts with C++ Essentials"
*/
class Employee
{
public:
   /**
      Constructs an employee with empty name and no salary.
   */
   Employee();
   /**
      Constructs an employee with a given name and salary.
      @param employee_name the employee name
      @param initial_salary the initial salary
   */
   Employee(string employee_name, double initial_salary);
   /**
      Sets the salary of this employee.
      @param new_salary the new salary value
   */
   void set_salary(double new_salary);
   /**
      Gets the salary of this employee.
      @return the current salary
   */
   double get_salary() const;
   /**
      Gets the name of this employee.
      @return the employee name
   */
   string get_name() const;
private:
   string name;
   double salary;
};

#endif

http://www.cplusplus.com/forum/general/113904/

You have to implement the functions in order to use them.
Thanks for the reply. I'm not sure what you mean. These are the error messages i'm getting, if that helps :
1>------ Build started: Project: ProgramClasses, Configuration: Debug Win32 ------
1> ProgramClasses.cpp
1>ProgramClasses.obj : error LNK2019: unresolved external symbol "public: __thiscall Employee::Employee(void)" (??0Employee@@QAE@XZ) referenced in function _main
1>ProgramClasses.obj : error LNK2019: unresolved external symbol "public: __thiscall Employee::Employee(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,double)" (??0Employee@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@N@Z) referenced in function _main
1>ProgramClasses.obj : error LNK2019: unresolved external symbol "public: void __thiscall Employee::set_salary(double)" (?set_salary@Employee@@QAEXN@Z) referenced in function _main
1>ProgramClasses.obj : error LNK2019: unresolved external symbol "public: double __thiscall Employee::get_salary(void)const " (?get_salary@Employee@@QBENXZ) referenced in function _main
1>ProgramClasses.obj : error LNK2019: unresolved external symbol "public: __thiscall Time::Time(int,int,int)" (??0Time@@QAE@HHH@Z) referenced in function _main
1>ProgramClasses.obj : error LNK2019: unresolved external symbol "public: __thiscall Time::Time(void)" (??0Time@@QAE@XZ) referenced in function _main
1>ProgramClasses.obj : error LNK2019: unresolved external symbol "public: int __thiscall Time::get_hours(void)const " (?get_hours@Time@@QBEHXZ) referenced in function _main
1>ProgramClasses.obj : error LNK2019: unresolved external symbol "public: int __thiscall Time::get_minutes(void)const " (?get_minutes@Time@@QBEHXZ) referenced in function _main
1>ProgramClasses.obj : error LNK2019: unresolved external symbol "public: int __thiscall Time::get_seconds(void)const " (?get_seconds@Time@@QBEHXZ) referenced in function _main
1>C:\Users\SHUTitDOWNx\Desktop\CP2\ProgramClasses\Debug\ProgramClasses.exe : fatal error LNK1120: 9 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Your tutor has provided declarations for all those methods in the header file, but nowhere in the code you've posted is there any definition of those functions - i.e. the code that defines what they actually do. Presumably, you're supposed to actually write those functions.

Unless your professor has provided those definitions too, in the form of a library, or an object file, or a source code file that you haven't shown us?

Topic archived. No new replies allowed.