Hi- Working on an assignment that involves using to classes - one for the Points on a line and the other for the LineSegment. The code seems to work but when I try to run a test against the test script I get this error message.
/tmp/ccnPvsEd.o: In function `Point::Point(double, double)':
Point.cpp:(.text+0x0): multiple definition of `Point::Point(double, double)'
/tmp/ccyuvj0A.o:LineSegment.cpp:(.text+0x0): first defined here
/tmp/ccnPvsEd.o: In function `Point::setXCoord(double)':
Point.cpp:(.text+0x10c): multiple definition of `Point::setXCoord(double)'
/tmp/ccyuvj0A.o:LineSegment.cpp:(.text+0x10c): first defined here
/tmp/ccnPvsEd.o: In function `Point::setYCoord(double)':
Point.cpp:(.text+0x126): multiple definition of `Point::setYCoord(double)'
/tmp/ccyuvj0A.o:LineSegment.cpp:(.text+0x126): first defined here
/tmp/ccnPvsEd.o: In function `Point::Point(double, double)':
Point.cpp:(.text+0x0): multiple definition of `Point::Point(double, double)'
/tmp/ccyuvj0A.o:LineSegment.cpp:(.text+0x0): first defined here
/tmp/ccnPvsEd.o: In function `Point::Point()':
Point.cpp:(.text+0x3a): multiple definition of `Point::Point()'
/tmp/ccyuvj0A.o:LineSegment.cpp:(.text+0x3a): first defined here
/tmp/ccnPvsEd.o: In function `Point::Point()':
Point.cpp:(.text+0x3a): multiple definition of `Point::Point()'
/tmp/ccyuvj0A.o:LineSegment.cpp:(.text+0x3a): first defined here
/tmp/ccnPvsEd.o: In function `Point::distanceTo(Point)':
Point.cpp:(.text+0x68): multiple definition of `Point::distanceTo(Point)'
/tmp/ccyuvj0A.o:LineSegment.cpp:(.text+0x68): first defined here
/tmp/ccnPvsEd.o: In function `Point::getXCoord()':
Point.cpp:(.text+0x142): multiple definition of `Point::getXCoord()'
/tmp/ccyuvj0A.o:LineSegment.cpp:(.text+0x142): first defined here
/tmp/ccnPvsEd.o: In function `Point::getYCoord()':
Point.cpp:(.text+0x15c): multiple definition of `Point::getYCoord()'
/tmp/ccyuvj0A.o:LineSegment.cpp:(.text+0x15c): first defined here
Also, not sure what the best way to insert code into these forums is so please excuse me if this is not the best way.
But, here is the code I have for the Point class. Any help is much appreciated.