class error

Im getting and error while trying to calculate the distance between two points i have constructed using classes

heres my code and error message for reference

thanks for the help

hw6.cpp:(.text+0x3f9): undefined reference to `Point::Point(Point const&)'
hw6.cpp:(.text+0x406): undefined reference to `Point::Point(Point const&)'
collect2: ld returned 1 exit status


double distance = 0.0;
double X = 0.0;
double X2 = 0.0;
double Y = 0.0;
double Y2 = 0.0;

X = Centroid.GetXCoordinate();
X2 = Centroid2.GetXCoordinate();
Y = Centroid.GetYCoordinate();
Y2 = Centroid2.GetYCoordinate();

distance = sqrt(pow(X-X2,2)+pow(Y-Y2,2));
You declared Point copy constructor but you aren't defining it or you aren't linking the file in which you defined it
Topic archived. No new replies allowed.