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
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