I have a function
void subtract(Interval I);
that will not recognize the parameter,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

void subtractBuildings(double borderLength)
{
IntervalSet highway(0.0, borderLength);
double x1, x2;
cin >> x1 >> x2;
while (x1 <= x2)
{
Interval building (x1, x2);
highway.subtract(building);
cin >> x1 >> x2;
}
double sum = highway.sum();
cout << "The total planting length is "
<< setiosflags(ios::fixed) << setprecision(1) << sum << endl;
}
 
It keeps giving me the errors:
error: 'Interval' is not a type
error: 'Interval' is not a type
In function 'void subtractBuildings(double)':
error: no matching function for call to 'IntervalSet::subtract(Interval&)'
note: candidate is:
note: void IntervalSet::subtract(int)
note: no known conversion for argument 1 from 'Interval' to 'int'
There is a header file that creates the interval and that works fine. I don't understand why it will not take the parameter and what its talking about about converting to int. I have an subtract function in the cpp file
void IntervalSet::subtract(Interval I)
but it still doesn't recognize the parameter.