Question: + C Line2D.cpp C Line2D.hpp 1 -+// Do not modify this file 2 #include 3 #include 4 5 class Line2D { 6 public: 7 Line2D

 + C Line2D.cpp C Line2D.hpp 1 -+// Do not modify thisfile 2 #include 3 #include 4 5 class Line2D { 6 public:7 Line2D () ; 8 Line2D (std: : pair point1, std: :pair

+ C Line2D.cpp C Line2D.hpp 1 -+// Do not modify this file 2 #include 3 #include 4 5 class Line2D { 6 public: 7 Line2D () ; 8 Line2D (std: : pair point1, std: :pair point2) ; 9 10 int length () const; // Find the length of the line to the nearest whole number 11 bool areParallel (Line20 other) const ; // Find if the two lines are parallel 12 void print() const; // Print out the line in the form '{{x1, yl], {x2, y2}}' exactly 13 14 private: 15 std: :pair mPoint1{ }; 16 std: : pair mPoint2{ }; 17 };Unable to build program BUILD OUTPUT /usr/sbin/ld: /tmp/cchiMt2s.o: in function *makeLine() ' : main. cpp: (. text+0xc0): undefined reference to *Line2D: : Line20(std: :pair, std: :pair)' /usr/sbin/ld: /tmp/cchiMt2s.o: in function *main' : main. cpp: (. text+0x154): undefined reference to *Line20: : Line2D()' /usr/sbin/ld: main. cpp: (. text+0x212): undefined reference to *Line2D: : Line20(std: : pair, std: : pair)' /usr/sbin/ld: main. cpp: (. text+0x2d0) : undefined reference to *Line2D: : Line2D(std: :pair, std: :pair)' collect2: error: ld returned 1 exit statusHi, this is likely as you have not included a base/stub implementation of all of the functions (the implementation can be empty but just has to exist). Could you please try do this and see if it clears the errors. See below for example of stub implementation of a class function. C+ + L d 1 // Base/stub implementation 2 // Example class definition 3 class MyClass { 4 MyClass () ; 5 6 // More members/ functions below. . . 8 9 / / Stub implementation of constructor 10 MyClass: : MyClass () { 11 12 } Comment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!