记录详情

Compile Error

foo.cc:19:83: error: ‘by’ has not been declared
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                                   ^~
foo.cc:19:86: error: ‘bm’ has not been declared
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                                      ^~
foo.cc:19:89: error: ‘bd’ has not been declared
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                                         ^~
foo.cc:19:77: error: ISO C++ forbids declaration of ‘Birth’ with no type [-fpermissive]
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                             ^~~~~
foo.cc:19:91: error: ‘int Person::Birth(int, int, int)’ conflicts with a previous declaration
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                                           ^
foo.cc:16:14: note: previous declaration ‘Date Person::Birth’
   16 |         Date Birth;
      |              ^~~~~
foo.cc:19:99: error: ‘ly’ has not been declared
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                                                   ^~
foo.cc:19:102: error: ‘lm’ has not been declared
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                                                      ^~
foo.cc:19:105: error: ‘ld’ has not been declared
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                                                         ^~
foo.cc:19:93: error: ISO C++ forbids declaration of ‘Leave’ with no type [-fpermissive]
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                                             ^~~~~
foo.cc:21:9: error: ‘int Person::Leave(int, int, int)’ conflicts with a previous declaration
   21 |         }
      |         ^
foo.cc:17:14: note: previous declaration ‘Date Person::Leave’
   17 |         Date Leave;
      |              ^~~~~
foo.cc:22:14: error: variable or field ‘Output’ declared void
   22 |         void Output{
      |              ^~~~~~
foo.cc:25:9: error: expected ‘;’ at end of member declaration
   25 |         }
      |         ^
      |          ;
foo.cc: In constructor ‘Person::Person(std::string&, int, int, int, int, int, int)’:
foo.cc:19:75: error: no matching function for call to ‘Date::Date()’
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                           ^
foo.cc:9:9: note: candidate: ‘Date::Date(int, int, int)’
    9 |         Date(int y,int m,int d):year(y),month(m),day(d){
      |         ^~~~
foo.cc:9:9: note:   candidate expects 3 arguments, 0 provided
foo.cc:4:7: note: candidate: ‘constexpr Date::Date(const Date&)’
    4 | class Date{
      |       ^~~~
foo.cc:4:7: note:   candidate expects 1 argument, 0 provided
foo.cc:4:7: note: candidate: ‘constexpr Date::Date(Date&&)’
foo.cc:4:7: note:   candidate expects 1 argument, 0 provided
foo.cc:19:75: error: no matching function for call to ‘Date::Date()’
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                           ^
foo.cc:9:9: note: candidate: ‘Date::Date(int, int, int)’
    9 |         Date(int y,int m,int d):year(y),month(m),day(d){
      |         ^~~~
foo.cc:9:9: note:   candidate expects 3 arguments, 0 provided
foo.cc:4:7: note: candidate: ‘constexpr Date::Date(const Date&)’
    4 | class Date{
      |       ^~~~
foo.cc:4:7: note:   candidate expects 1 argument, 0 provided
foo.cc:4:7: note: candidate: ‘constexpr Date::Date(Date&&)’
foo.cc:4:7: note:   candidate expects 1 argument, 0 provided
foo.cc:19:76: error: expected ‘{’ at end of input
   19 |         Person(string& n,int by,int bm,int bd,int ly,int lm,int ld):Name(n);Birth(by,bm,bd);Leave(ly,lm,ld){
      |                                                                            ^
foo.cc: In member function ‘int Person::Leave(int, int, int)’:
foo.cc:21:9: warning: no return statement in function returning non-void [-Wreturn-type]
   21 |         }
      |         ^
foo.cc: In function ‘int main()’:
foo.cc:45:12: error: ‘class Person’ has no member named ‘printInfo’
   45 |         p1.printInfo();
      |            ^~~~~~~~~
foo.cc:46:12: error: ‘class Person’ has no member named ‘printInfo’
   46 |         p2.printInfo();
      |            ^~~~~~~~~
foo.cc: At global scope:
foo.cc:47:6: error: expected unqualified-id before ‘else’
   47 |     }else{
      |      ^~~~
foo.cc:51:9: error: expected unqualified-id before ‘return’
   51 |         return 0;
      |         ^~~~~~
foo.cc:52:1: error: expected declaration before ‘}’ token
   52 | }
      | ^

信息

递交者
类型
自测
语言
C++
递交时间
2025-04-12 17:12:50
评测时间
2025-04-12 17:12:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes