Iphone Objective-C iOS应用程序-找不到符号
这是我的代码:Iphone Objective-C iOS应用程序-找不到符号,iphone,objective-c,ios4,Iphone,Objective C,Ios4,这是我的代码: - (double)performOperation:(NSString *)operation { if([operation isEqual:@"sqrt"]) operand = srqt(operand); return operand; } 这就是阻止我的应用程序运行的错误 Undefined symbols: "_srqt", referenced from: -[CalculatorBrain performOper
- (double)performOperation:(NSString *)operation {
if([operation isEqual:@"sqrt"])
operand = srqt(operand);
return operand;
}
这就是阻止我的应用程序运行的错误
Undefined symbols:
"_srqt", referenced from:
-[CalculatorBrain performOperation:] in CalculatorBrain.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
嘿!嘿D
if([operation isEqual:@"sqrt"])
operand = srqt(operand);
请注意,第二行中的sqrt函数拼写错误。也就是说,除非您定义了自己的srqt函数。但是根据链接器错误,您似乎没有这样做。yo writed operand=srqtorand;但意味着操作数=sqrtoperand 这是sqrt而不是srqt。还有七个角色来证明我是人类…好的,这样做吧
#include <math.h>
然后检查srqt上的拼写,它应该是sqrt。OMG,它确实值得失败当您进行字符串比较时,请使用isEqualToString:而不是isEqual。