2011-03-29 68 views
0

這是我的代碼:Objective-C的iOS應用程式 - 圖形符號未找到

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

Heeeelp錯誤! :d

+0

OMG,它值得一個#FAIL – 2011-03-29 15:14:49

+0

當你做字符串比較時,使用isEqualToString:而不是isEqual。 – Konrad77 2011-03-29 15:20:59

回答

5
if([operation isEqual:@"sqrt"]) 
    operand = srqt(operand); 

請注意您有拼寫錯誤的功能sqrt在第二行。也就是說,除非你已經定義了你自己的srqt函數。但根據鏈接錯誤,似乎你沒有。

5

喲寫道operand = srqt(operand);,但意味着operand = sqrt(operand);

0

這是sqrtsrqt。七個更多的字符來證明我的人......

0

OK,這樣做

#include <math.h> 

然後檢查srqt(),它應該被開方拼寫()。

相關問題