Reputation: 2099
This is my code:
- (double)performOperation:(NSString *)operation {
if([operation isEqual:@"sqrt"])
operand = srqt(operand);
return operand;
}
And this is the error that is preventing my app from running
Undefined symbols:
"_srqt", referenced from:
-[CalculatorBrain performOperation:] in CalculatorBrain.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Heeeelp! :D
Upvotes: 0
Views: 356
Reputation: 1671
OK, do this
#include <math.h>
Then check your spelling on srqt(), it should be sqrt().
Upvotes: 0
Reputation: 16540
It is sqrt
not srqt
. and seven more characters to prove I'm human...
Upvotes: 0
Reputation: 3390
yo wrote operand = srqt(operand);
but meant operand = sqrt(operand);
Upvotes: 5
Reputation: 14777
if([operation isEqual:@"sqrt"])
operand = srqt(operand);
Notice that you have misspelled the sqrt
function in the second line. That is, unless you have defined your own srqt
function. But according to the linker error, it seems that you have not.
Upvotes: 5