2013-05-26 82 views
0

我越來越想用C的math.h庫時,出現以下錯誤:iOS的數學:未定義的符號FR架構ARM7

#import <Foundation/Foundation.h> 
#import <math.h> 

@interface Filter : NSObject { 
    float cutoff; 
    float resonance; 
    float sampleRate; 
    float *f; 
    float freq; 
    float damp; 
} 

- (float)filter:(float)input; 

@end 

你能告訴我怎樣才能解決這個問題?看起來min()函數不能被編譯爲armv7架構。

Undefined symbols for architecture armv7: 
    "_min", referenced from: 
     -[Filter init] in Filter.o 
ld: symbol(s) not found for architecture armv7 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
+1

其中是代碼中的min()?並且你不需要導入'math.h' –

+1

http://www.cplusplus.com/reference/cmath/ - 似乎不包含任何min(),但只有fmin() –

+0

感謝Anoop和alex,你都是對的。我已經刪除了math.h的導入,並且使用了fmin。現在工作一切正常。 – ndrizza

回答

0

在iOS上,我必須使用fmin()而不是min()作爲alex的用途。此外,我甚至不需要像Anoop所說的那樣導入math.h

1

你鏈接被編譯爲i386或x86-64的,在特定情況下,靜態庫我認爲你引用了包含分功能,但不編譯ARMv7架構庫,採取看看你引用的靜態庫。