Chrono.cpp と Chrono.h の 2 つのファイルがあります。
Chrono.h
class Appointment {
public:
Appointment( Date d , string n ) ;
Appointment() ;
int get_day() const { return date.d; }
int get_month() const { return date.m; }
int get_year() const { return date.y; }
string get_name() const { return name ; }
Date date ;
string name ;
} ;
Chrono.cpp
Appointment::Appointment( Date dd , string nn )
: date( dd ) , name( nn )
{
//if(!is_date(yy,mm,dd))throw Invalid();
}
このエラー、または .h ファイルと一致しないというバリエーションが引き続き発生します。
Chrono.cpp:17:1: error: prototype for āChrono::Appointment::Appointment(Chrono::Date, String)ā does not match any in class āChrono::Appointmentā
Chrono.h:34:7: error: candidates are: Chrono::Appointment::Appointment(Chrono::Appointment&&)
Chrono.h:34:7: error: Chrono::Appointment::Appointment(const Chrono::Appointment&)
Chrono.h:42:2: error: Chrono::Appointment::Appointment(Chrono::Date, std::string)
Chrono.h:41:2: error: Chrono::Appointment::Appointment()
どちらのファイルにも #include 文字列があり、.cpp ファイルは std 名前空間にあります。また、ヘッダー ファイルで std::string を使用してみました。私がやったことはこれまでのところうまくいきませんでした。どんな助けでも大歓迎です。また、Date は別の場所で定義されており、正しく機能していることにも注意してください。