Hello, I have a lot of errors but of the same class I think
Chromosome.cc: In constructor ‘Chromosome::Chromosome(Individual**, int)’:
Chromosome.cc:12:29: error: invalid use of incomplete type ‘class Individual’
sequence = new Individual[s];
^
In file included from Chromosome.cc:6:
Chromosome.h:6:7: note: forward declaration of ‘class Individual’
class Individual;
^~~~~~~~~~
Chromosome.cc:15:13: error: invalid use of incomplete type ‘class Individual’
sequence[i]=indiv[i];
...............
The compiler needs to know what an Individual is before it can make use of it. You have to show it all about an Individial. Typically, this is done by including a header file. Where is your declaration of Individual class?
A forward declaration is not enough. A forward declaration is just a promise that it does exist, but to actually make use of one, a forward declaration is not enough.
Also, your constructors make no sense. One of them thinks sequence is an array, one of them creates something called sequence that is a vector.
This constuctor,
1 2
Chromosome::Chromosome(int s)
: size(s)
goes to a lot of effort to create and populate vector<Individual> sequence; and promptly throws it away at the end of the constructor. You're just throwing it away. This makes no sense.