Record Detail

Compile Error

/in/MyPoint.cpp: In member function 'void MyPoint::init(int, int)':
/in/MyPoint.cpp:10:24: error: parameter 'x' set but not used [-Werror=unused-but-set-parameter]
 void MyPoint::init(int x, int y) {
                        ^
/in/MyPoint.cpp:10:31: error: parameter 'y' set but not used [-Werror=unused-but-set-parameter]
 void MyPoint::init(int x, int y) {
                               ^
/in/MyPoint.cpp: In member function 'double MyPoint::distance(MyPoint&, MyPoint&)':
/in/MyPoint.cpp:33:12: error: variable 'dist' set but not used [-Werror=unused-but-set-variable]
     double dist;
            ^~~~
/in/MyPoint.cpp:35:1: error: no return statement in function returning non-void [-Werror=return-type]
 }
 ^
cc1plus: all warnings being treated as errors
/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:8:7: note: candidate: MyPoint::MyPoint()
 class MyPoint{
       ^~~~~~~
/in/MyPoint.h:8:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:8:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:8: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:8:7: note: candidate: MyPoint::MyPoint()
 class MyPoint{
       ^~~~~~~
/in/MyPoint.h:8:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:8:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:8:7: note:   candidate expects 1 argument, 2 provided
/in/compile/ex1.cpp:12:29: error: no matching function for call to 'MyPoint::distance(MyPoint&)'
         cout<<p1.distance(p2)<<endl;
                             ^
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:13:12: note: candidate: double MyPoint::distance(MyPoint&, MyPoint&)
     double distance(MyPoint &p1, MyPoint &p2);
            ^~~~~~~~
/in/MyPoint.h:13:12: note:   candidate expects 2 arguments, 1 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:8:7: note: candidate: MyPoint::MyPoint()
 class MyPoint{
       ^~~~~~~
/in/MyPoint.h:8:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:8:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:8: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:8:7: note: candidate: MyPoint::MyPoint()
 class MyPoint{
       ^~~~~~~
/in/MyPoint.h:8:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:8:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:8:7: note:   candidate expects 1 argument, 2 provided
/in/compile/ex1.cpp:25:29: error: no matching function for call to 'MyPoint::distance(MyPoint&)'
         cout<<p1.distance(p2)<<endl;
                             ^
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:13:12: note: candidate: double MyPoint::distance(MyPoint&, MyPoint&)
     double distance(MyPoint &p1, MyPoint &p2);
            ^~~~~~~~
/in/MyPoint.h:13:12: note:   candidate expects 2 arguments, 1 provided
/in/compile/ex1.cpp:30:29: error: no matching function for call to 'MyPoint::distance(MyPoint&)'
         cout<<p1.distance(p2)<<endl;
                             ^
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:13:12: note: candidate: double MyPoint::distance(MyPoint&, MyPoint&)
     double distance(MyPoint &p1, MyPoint &p2);
            ^~~~~~~~
/in/MyPoint.h:13:12: note:   candidate expects 2 arguments, 1 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:8:7: note: candidate: MyPoint::MyPoint()
 class MyPoint{
       ^~~~~~~
/in/MyPoint.h:8:7: note:   candidate expects 0 arguments, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:8:7: note:   candidate expects 1 argument, 2 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:8:7: note:   candidate expects 1 argument, 2 provided
/in/compile/ex1.cpp:37:29: error: no matching function for call to 'MyPoint::distance(MyPoint&)'
         cout<<p1.distance(p2)<<endl;
                             ^
In file included from /in/compile/ex1.cpp:2:0:
/in/MyPoint.h:13:12: note: candidate: double MyPoint::distance(MyPoint&, MyPoint&)
     double distance(MyPoint &p1, MyPoint &p2);
            ^~~~~~~~
/in/MyPoint.h:13:12: note:   candidate expects 2 arguments, 1 provided

Information

Submit By
Type
Submission
Homework
Homework 7
Language
C++
Submit At
2022-07-24 01:29:31
Judged At
2022-07-26 11:16:09
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes