C++ error: no matching constructor for initialization of

In the line you are trying to invoke the default constructor of Rectangle. The compiler does not generate such a default constructor anymore, because your Rectangle has a user defined constructor that takes 2 parameters. Therefore, you need to specify the parameters, like The error I get when compiling your code is: Rectangle.cpp:8:15: error: no matching function for … Read more