Question
Hi, So below are 3 files I have for a multifile project and i keep getting an error of: Undefined symbols for architecture x86_64: _main,
Hi, So below are 3 files I have for a multifile project and i keep getting an error of: Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) (1)fraction.h #include
(3) client.cpp
/*Client.cpp is set-up as a fraction class implementation and test driver program - DO NOT CHANGE SOURCE CODE
All necessary class objects are declared and defined here to test various class related operations.
HINT: see comments for specific class related function calls*/
#include
#include "fraction.h"
using namespace std;
int main()
{
fraction f1(9,8); //calling a parameterized class constructor
fraction f2(2,3);
fraction result; //calling a default class constructor
const fraction f3(12, 8);
const fraction f4(202, 303);
fraction f5,f6;
cout<<"C++ CLASS MULTI-FILE PROJECT"< cout<<"Client.cpp - testing a fraction class implementation "; cout<<"---------------------------------------------------- "; cout << "The result object starts off at "; result.showFraction(); //calling a void "observer" function cout << endl; cout<<" Arithmetic operations with fraction objects stored in the results class object "; cout<<"------------------------------------------------------------------------------ "; cout << "The sum of "; f1.showFraction(); cout << " and "; f2.showFraction(); cout << " is "; result = f1.AddedTo(f2); //a class binary operation - a value-returning "observer" function result.showFraction(); cout << endl; cout << "The difference of "; f1.showFraction(); cout << " and "; f2.showFraction(); cout << " is "; result = f1.Subtract(f2); //a class binary operation - a value-returning "observer" function result.showFraction(); cout << endl; cout << "The product of "; f1.showFraction(); cout << " and "; f2.showFraction(); cout << " is "; result = f1.MultipliedBy(f2); //a class binary operation - a value-returning "observer" function result.showFraction(); cout << endl; result = f3.DividedBy(f4); //a class binary operation - a value-returning "observer" function cout << "The quotient of "; f3.showFraction(); cout << " and "; f4.showFraction(); cout << " is "; result.showFraction(); cout << endl; cout<<" Input and Output operations for two new class objects "; cout<<"----------------------------------------------------- "; f5.getFraction(); //a class input operation - a transformer or setter function f5.showFraction(); //a class output operation - an observer or getter function cout< f6.getFraction(); f6.showFraction(); cout< cout<<" A Boolean operation comparing two class objects "; cout<<"------------------------------------ "; if (f5.isGreaterThan(f6)){ //a class relational expression - boolean operation/function f5.showFraction(); cout <<" is greater than "; f6.showFraction(); cout< } else { f5.showFraction(); cout <<" is less than "; f6.showFraction(); cout< } cout<<" --------------------------------------------------------- "; cout<<" Fraction class implementation test now successfully concluded "; // system ("PAUSE"); return 0; } How do I fix this error?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started