No matching function for call to [class]

Hey there guys.

I'm having this pain in the ass error (No matching function for call to Data::Data() ) on this block of code:

1
2
3
4
5
6
Etapa::Etapa(string nm, float dist, string loc, Data dt) {
	nome = nm;
	distancia = dist;
	local = loc;
	data = dt;
}


This is my Etapa class:

1
2
3
4
5
6
7
8
class Etapa {
	string nome;
	float distancia;
	string local;
	Data data;
	vector<Resultado *> results;
	//vector<Premio *> prems;
public:...


and this is my Data Class

1
2
3
4
5
6
7
8
9
class Data

{

	unsigned int mes;
	unsigned int dia;
	unsigned int ano;

public:...


I guess this is happening because I'm trying to give Etapa an argument of Data type and I can't do it or put it in a variable since it has 3 parameteres (mes, dia, ano).

Any help will be appreciated.

Regards
You need either a copy constructor or an operator = for your Data class.
I would guess that you have the default constructor of your Data class defined as private, rather than public, though I can't say for sure without seeing the whole of your Data class declaration.
Topic archived. No new replies allowed.