Why this code is giving me undefined reference to Time
Thanks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#ifndef TIME_H
#define TIME_H
// Time class definition
class Time
{
public:
Time(); // constructor
void setTime( int, int, int ); // set hour, minute and second
void printUniversal(); // print time in universal-time format
void printStandard(); // print time in standard-time format
private:
int hour; // 0 - 23 (24-hour clock format)
int minute; // 0 - 59
int second; // 0 - 59
}; // end class Time
#endif
@Moschops is not using any IDE for wiriting his programs, so you can use this approach if you also don't use one. That is wirte each file separately (in whatever text editor you like) and compile them together.
On the other hand if you use one then you can check if all files are included in your project. Probably you leave some file out will compiling. You specically need to tell which files are included in your project