C++ - Ощибка при компиляций

#include <bits/stdc++.h>
using namespace std;

class Rect{
public:
    Rect(int w, int h){
        width=w; height=h;
    }

    int width=0;

    int height=0;
};

class Square : private Rect{
public:
    Square();

    Rect setSize(int w, int h){
        return setSize(w, h);
    }

    Rect getSize(){
        return getSize();
    }
};

int main(){
    Square square;
    square.setSize(100, 100);
    square.getSize().width;
}

Ощибка:

/usr/bin/ld: /tmp/ccB5CxP8.o: in function `main':
main.cpp:(.text+0x10): undefined reference to `Square::Square()'
collect2: error: ld returned 1 exit status

Как исправить?


Ответы (0 шт):