ccc.time.h

Hi, I tried to run the following program:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  #include <iostream>

using namespace std;

#include "ccc_time.h"

int main()
 {
 Time wake_up(7, 0, 0);
 wake_up.add_seconds(1000); // A thousand seconds later
 cout << wake_up.get_hours()
 << ":" << wake_up.get_minutes()
 << ":" << wake_up.get_seconds() << "\n";

 Time now;
 int seconds_left = Time(23, 59, 59).seconds_from(now);

 cout << "There are "
 << seconds_left
 << " seconds left in this day.\n";

 return 0;
 }


but I got an error message saying:"fatal error:ccc_time: No such a file or directory". I use Codeblocks and Mingw. Does anyone know what's wrong with my program?

Thanks in advance.
You need to put ccc_time.h where the compiler can find it (in this case, if you put it in the same folder as your main file, you should be okay).

Presumably, you should also have a ccc_time.cpp file (or something of that sort) that holds the definitions of all of the Time member functions. That file will have to be compiled and linked in with your program as well.

The easiest way to do this in Code::Blocks is just to make a project with those files.
Thanks a lot.
Topic archived. No new replies allowed.