Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribedimage text in transcribed
+ 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions