Hello, I can't understand what compiler wants from me. I trying to create quite a big class structure with many abstract classes. Below is a part of the code with some of them. The compiler doesn't like my classes and says the he needs more constructor which I don't understand. Shouldn't he make his own default constructors? I put the copy constructors into the private part. Maybe it doesn't make much sense but even when I delete them the compiler still has a problem. I'm posting one class with and one without the copy constuctor so that you can see how it behaves in both cases.
#include<iostream>
using namespace std;
class Okno {
protected:
int x1,y1,x2,y2;
string nazwa;
public:
int daj_x1() {return x1;}
int daj_y1() {return y1;}
int daj_x2() {return x2;}
int daj_y2() {return y2;}
};
// subclasses of Okno
class NieDesktop : public Okno{
private:
NieDesktop(const NieDesktop&);
protected:
Okno& ojciec;
public:
NieDesktop(Okno&);
Okno& DajOjca();
};
NieDesktop::NieDesktop(Okno& _ojciec) : ojciec(_ojciec){}
Okno& NieDesktop::DajOjca(){
return ojciec;
}
//KONTROLKA
class Kontrolka : public NieDesktop{ //abstract
Kontrolka(const Kontrolka&);
};
class KontrolkaAtomowa : public Kontrolka{ //abstract
KontrolkaAtomowa(const KontrolkaAtomowa&);
};
class KontrolkaNieatomowa : public Kontrolka{ //abstract
//KontrolkaNieatomowa(const KontrolkaNieatomowa&);
};
int main(){}
Here are the compiler's messages:
30 [Warning] ` class Kontrolka' only defines private constructors and has no friends
33 [Warning] ` class KontrolkaAtomowa' only defines private constructors and has no friends
36 `Kontrolka' with only non-default constructor in class without a constructor