I'm getting some errors defining some functions here. I'm prohibited from changing my header files unfortunately :(
here are the four errors:
Book.cpp:20: error: prototype for ‘Book::Book()’ does not match any in class ‘Book’
Book.hpp:15: error: candidates are: Book::Book(const Book&)
Book.hpp:28: error: Book::Book(std::string, std::string, std::string)
Book.cpp: In member function ‘int Book::getCheckOutLength()’:
//Book.hpp
#ifndef BOOK_HPP
#define BOOK_HPP
#include <string>
class Patron;
// These three locations are mutually exclusive, but note that
// a Book can be on request for a Patron while being checked
// out to another Patron. In that case the Book's location is
// CHECKED_OUT, and when it is returned, it's location will
// become ON_HOLD_SHELF
enum Locale { ON_SHELF, ON_HOLD_SHELF, CHECKED_OUT };
class Book {
private:
std::string idCode;
std::string title;
std::string author;
Locale location;
Patron* checkedOutBy;
Patron* requestedBy;
int dateCheckedOut;
public:
staticconstint CHECK_OUT_LENGTH = 21;
Book(std::string idc, std::string t, std::string a);
int getCheckOutLength();
std::string getIdCode();
std::string getTitle();
std::string getAuthor();
Locale getLocation();
void setLocation(Locale);
Patron* getCheckedOutBy();
void setCheckedOutBy(Patron*);
Patron* getRequestedBy();
void setRequestedBy(Patron*);
int getDateCheckedOut();
void setDateCheckedOut(int);
};
#endif
Book.cpp:20: error: prototype for ‘Book::Book()’ does not match any in class ‘Book’
Here you implemented a Book constructor with no arguments, but in your class definition there is no Book constructor with no arguments. If you can't modify the include file then you need to delete this implementation.