Question: I am currently using c++ coding on xcode. Every time I try to run the program, it says linker command failed with exit code 1

I am currently using c++ coding on xcode. Every time I try to run the program, it says "linker command failed with exit code 1" and "unused variable 'result' ". I'm not sure what is wrong with what I am inputting.

#include

#define fiveFeetinInches 60

using namespace std;

int main()

{

int result, feet = 0, inches = 0, maleWeight, femaleWeight, totalInches ;

cout << "Please enter your height in feet and inches on separate lines. For Example: " << endl << "5" << endl << "3 " << endl;

cin >> feet;

cin >> inches;

totalInches = (feet * 12) + inches;

femaleWeight = ((totalInches - fiveFeetinInches) * 5) + 100;

maleWeight = ((totalInches - fiveFeetinInches) * 6) + 106;

cout << "Ideal Weight for Female of Height " << feet << "'" << inches << "\" : " << femaleWeight << endl;

cout << "Ideal Weight for Male of Height " << feet << "'" << inches << "\" :" << maleWeight << endl;

system("pause");

return 0;

}

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!