linker command failed with exit code 1 problem

Hi

Today I opened my program to double check if there was any bugs in my code and unfortunately it appears that the bug its my function prototype by the message of the compiler. For some weird reason this program was perfectly working with no bugs with the same codes and with no changes whatsoever in the code and then next day it gives me something different.

here is the code dealing with function to compute static formula.


#include <cmath>
#include <iostream>
using namespace std;

void maxDeflect(double, double, double, double, double, double& ); //prototype // & become result.

int main() {
double weight, length, elasticity, base, height, result;
cout<<"Chapter 6, Exercise 3: Calculating the maximum deflection using fucntions. "<<endl;
cout<<"\nEnter the Weight(lb): ";
cin>>weight;
cout<<"Enter the Lenght(ft):";
cin>>length;
cout<<"Enter the Modulus of Elasticity of the Beam (lb/ft2): "; // the instructions does not mention for the input but unfortunately the formula requires the input.
cin>>elasticity;
cout<<"Enter the Base(ft):";
cin>>base;
cout<<"Enter the Height (ft):";
cin>>height;
maxDeflect(weight, length, elasticity, base, height, result);// call for the function
cout<<"The maximum deflection is "<<result<<" In."<<endl;
return 0;
}

void mazDeflect(double weight, double length, double elasticity, double base, double height, double& result){
result = 4 * weight * pow(length, 3) / elasticity * base * pow(height, 3);
return;
}
Check the spelling of the function name in the prototype and definition - they aren't the same here.
I been trying to change the spelling but its still giving me the bug. any suggestions ?
So you did fix the spelling of mazDeflect? I can't see any other problems that would cause compiler or linker errors.
Last edited on
To WildBlue and Peter 87. Yes, it was the spelling of the function. Thanks for your help. :)
Topic archived. No new replies allowed.