Record Detail

Compile Error

In file included from /in/MyPoint.cpp:3:0:
/in/MyPoint.h:1:0: error: unterminated #ifndef
 #ifndef _MYPOINT_H_
 
/in/MyPoint.cpp:17:8: error: prototype for 'double MyPoint::distance()' does not match any in class 'MyPoint'
 double MyPoint::distance()
        ^~~~~~~
In file included from /in/MyPoint.cpp:3:0:
/in/MyPoint.h:12:10: error: candidate is: double MyPoint::distance(const MyPoint&)
   double distance(const MyPoint &rhs);
          ^~~~~~~~
/in/MyPoint.cpp:20:2: error: extra ';' [-Werror=pedantic]
 };
  ^
cc1plus: all warnings being treated as errors
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:1:0: error: unterminated #ifndef
 #ifndef _MYPOINT_H_
 
/in/compile/ex1.cpp: In function 'int main()':
/in/compile/ex1.cpp:11:25: error: no matching function for call to 'MyPoint::MyPoint(int&, int&)'
         MyPoint p1(x1,y1),p2(x2,y2);
                         ^
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:4:7: note: candidate: MyPoint::MyPoint()
 class MyPoint
       ^~~~~~~
/in/MyPoint.h:4:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided
/in/compile/ex1.cpp:11:35: error: no matching function for call to 'MyPoint::MyPoint(int&, int&)'
         MyPoint p1(x1,y1),p2(x2,y2);
                                   ^
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:4:7: note: candidate: MyPoint::MyPoint()
 class MyPoint
       ^~~~~~~
/in/MyPoint.h:4:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided
/in/compile/ex1.cpp:23:41: error: no matching function for call to 'MyPoint::MyPoint(int, int)'
         cout << p1.distance(MyPoint(0, 0)) << endl;
                                         ^
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:4:7: note: candidate: MyPoint::MyPoint()
 class MyPoint
       ^~~~~~~
/in/MyPoint.h:4:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided
/in/compile/ex1.cpp:24:41: error: no matching function for call to 'MyPoint::MyPoint(int, int)'
         cout << p2.distance(MyPoint(0, 0)) << endl;
                                         ^
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:4:7: note: candidate: MyPoint::MyPoint()
 class MyPoint
       ^~~~~~~
/in/MyPoint.h:4:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided
/in/compile/ex1.cpp:36:25: error: no matching function for call to 'MyPoint::MyPoint(int&, int&)'
         MyPoint p1(x1,y1),p2;
                         ^
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:4:7: note: candidate: MyPoint::MyPoint()
 class MyPoint
       ^~~~~~~
/in/MyPoint.h:4:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:4:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:4:7: note:   candidate expects 1 argument, 2 provided

Information

Submit By
Type
Submission
Homework
Homework 7
Language
C++
Submit At
2022-07-19 15:15:29
Judged At
2022-07-26 11:16:41
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes