Record Detail

Compile Error

/in/Rectangle.cpp:11:6: error: prototype for 'void Rectangle::isRect()' does not match any in class 'Rectangle'
 void Rectangle::isRect(){
      ^~~~~~~~~
In file included from /in/Rectangle.cpp:4:0:
/in/Rectangle.h:15:10: error: candidate is: void Rectangle::isRect(std::vector<MyPoint>*)
     void isRect(vector<MyPoint> v[4]);
          ^~~~~~
/in/Rectangle.cpp: In member function 'void Rectangle::getArea(std::vector<MyPoint>*)':
/in/Rectangle.cpp:16:44: error: unused parameter 'v' [-Werror=unused-parameter]
 void Rectangle::getArea(vector<MyPoint> v[4]) {
                                            ^
cc1plus: all warnings being treated as errors
/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) {
                               ^
cc1plus: all warnings being treated as errors
/in/compile/ex2.cpp: In function 'int main()':
/in/compile/ex2.cpp:12:18: error: no matching function for call to 'Rectangle::Rectangle(<brace-enclosed initializer list>)'
     Rectangle r{m};
                  ^
In file included from /in/compile/ex2.cpp:4:0:
/in/Rectangle.h:12:7: note: candidate: Rectangle::Rectangle()
 class Rectangle {
       ^~~~~~~~~
/in/Rectangle.h:12:7: note:   candidate expects 0 arguments, 1 provided
/in/Rectangle.h:12:7: note: candidate: constexpr Rectangle::Rectangle(const Rectangle&)
/in/Rectangle.h:12:7: note:   no known conversion for argument 1 from 'std::vector<MyPoint>' to 'const Rectangle&'
/in/Rectangle.h:12:7: note: candidate: constexpr Rectangle::Rectangle(Rectangle&&)
/in/Rectangle.h:12:7: note:   no known conversion for argument 1 from 'std::vector<MyPoint>' to 'Rectangle&&'
/in/compile/ex2.cpp:13:18: error: no matching function for call to 'Rectangle::isRect()'
     if (r.isRect()) {
                  ^
In file included from /in/compile/ex2.cpp:4:0:
/in/Rectangle.h:15:10: note: candidate: void Rectangle::isRect(std::vector<MyPoint>*)
     void isRect(vector<MyPoint> v[4]);
          ^~~~~~
/in/Rectangle.h:15:10: note:   candidate expects 1 argument, 0 provided
/in/compile/ex2.cpp:14:32: error: no matching function for call to 'Rectangle::getArea()'
         std::cout << r.getArea() << std::endl;
                                ^
In file included from /in/compile/ex2.cpp:4:0:
/in/Rectangle.h:14:10: note: candidate: void Rectangle::getArea(std::vector<MyPoint>*)
     void getArea(vector<MyPoint> v[4]);
          ^~~~~~~
/in/Rectangle.h:14:10: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/compile/ex2.cpp:1:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = MyPoint; _Args = {int&, int&}; _Tp = MyPoint]':
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = MyPoint; _Args = {int&, int&}; _Tp = MyPoint; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<MyPoint>]'
/usr/include/c++/7/bits/vector.tcc:100:30:   required from 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {int&, int&}; _Tp = MyPoint; _Alloc = std::allocator<MyPoint>; std::vector<_Tp, _Alloc>::reference = MyPoint&]'
/in/compile/ex2.cpp:10:36:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: new initializer expression list treated as compound expression [-fpermissive]
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/ext/new_allocator.h:136:4: error: no matching function for call to 'MyPoint::MyPoint(int&)'
In file included from /in/Rectangle.h:7:0,
                 from /in/compile/ex2.cpp:4:
/in/MyPoint.h:8:7: note: candidate: MyPoint::MyPoint()
 class MyPoint{
       ^~~~~~~
/in/MyPoint.h:8:7: note:   candidate expects 0 arguments, 1 provided
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(const MyPoint&)
/in/MyPoint.h:8:7: note:   no known conversion for argument 1 from 'int' to 'const MyPoint&'
/in/MyPoint.h:8:7: note: candidate: constexpr MyPoint::MyPoint(MyPoint&&)
/in/MyPoint.h:8:7: note:   no known conversion for argument 1 from 'int' to 'MyPoint&&'

Information

Submit By
Type
Submission
Homework
Homework 8
Language
C++
Submit At
2022-07-30 22:52:56
Judged At
2022-08-02 15:55:02
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes