Undefined reference to error / No matching function

Hi,

I'm busy with an assignment and have this below problem which I just cant seem to find a solution for.

The error i'm getting is "no matching function for call point".

Some notes:
1. my classes are all in 1 file. class "Point" is above class "Line".
2. the error indicates a problem on the constructor for "Line" class. Line (Point p1,Point p2) : Shape() . Then i thought maybe "Point" requires a default constructor. Once i add Point(); before the constructor in "Point" class - i get the error "Undefined reference to error" on line " Line (Point p1,Point p2) : Shape()"
3. If i change the system around and get rid of the constructor , then it works fine, but unfortunately i have to use constructors in this assignment.

Im not too sure if its the inheritance that im calling in Line class that's causing an issue.

Any help would be appreciated.

//############################################################
//############# Point ####################
//############################################################

class Point {
private:
int x;
int y;

public:
Point(int xx, int yy ){
x = xx;
y = yy;
}

int getY(){
return x;
}

QString toString();


int getX(){
return y;
}

};
//############################################################
//############# LINE ####################
//############################################################


class Line : public Shape{
private:
Point oneEnd;
Point otherEnd;
public:

Line (Point p1,Point p2) : Shape()
{
oneEnd = p1;
otherEnd = p2;
}

QString getName(){
return "Line";
}

double getArea(){
return 0; //line is 0
}

QString toString(){

return this->toString();
}
};
Topic archived. No new replies allowed.