I'm trying to create a Makefile which compiles a specific program.
I have 1x .cpp file and 2x .h files.
So I would go
g++ source.cpp header1.h header2.h -o programOut
The thing is i'm getting an error.
Mainly in the second header file where Appointments is a class defined in the first header file. The second header file mainly contains (function prototypes?) I just got the other functions that I used, removed the implementation and placed it in there.
error: ‘Appointments’ does not name a type
error: ISO C++ forbids declaration of ‘left’ with no type
error: ‘Appointments’ does not name a type
error: ISO C++ forbids declaration of ‘right’ with no type
error: ‘string’ does not name a type
error: ‘time_t’ does not name a type
It compiles fine if I go g++ source.cpp -o programOut however when I added the .h files when i type g++, it gives me the error shown above. Any ideas why?