in a folder I got the following files:
book.h, book.cpp , card.h, card.cpp
these are the content of the book.h
class book {
public:
string title;
string author;
string get_title();
string get_author();
}
book::book(string title, string author){
title = title;
author = author;
}
this is my book.cpp:
#include <book.h>
#include <iostream>
#include <string>
using namespace std;
string book::get_title(){
return title;
}
string book::get_author(){
return author;
}
int main(){
cout << ¨it works! \n¨
}
I I try to compile using g++ -c book.cpp, I keep getting an error message saying:
book.cpp:1:18: fatal error: book.h: No such file or directory compilation terminated.