I have three files. When i try to compile I get sooo many errors I have no clue what to do.
main.cpp
1 2 3 4 5 6
|
#include <iostream>
#include <iomanip>
using namespace std;
#include "Clock.h"
code
|
Clock.h
1 2 3 4 5 6 7 8 9
|
#ifndef Clock_H
#define Clock_H 1
#include <iostream>
class Clock {
private: yada yada
public: yada yada
friend ostream &operator<<(ostream &, Clock&);
};
#endif
|
Clock.cpp
1 2 3 4 5
|
#include <iostream>
#include "Clock.h"
ostream &ostream &operator<<(ostream &out, Clock &time){
code }
Clock::ya das}
|
When I try to get it compiled these errors all occur.
in main.cpp:
Clock.h:35:9 error: 'ostream' does not name a type
'cout' was not declared in this scope
'endl' was not declared in this scope
'cout' was not declared in this scope
'endl' was not declared in this scope
'cin' was not declared in this scope
in Clock.cpp:
Clock.h:35:9: error: 'ostream' does not name a type
'ostream' does not name a type
'cout' was not declared in this scope
suggested alternative: /usr/include/c++/4.6/iostream::62:18: note: 'std::cout'
'endl' was not declared in this scope
suggested alternative: /usr/include/c++/4.6/ostream:543:5: note: 'std::endl'
I have no clue what I need to change...