在Mountain Lion中使用libFlac和Xcode [英] Using libFlac with Xcode in Mountain Lion
问题描述
我决定在objective-c和cocoa中编写一个简单的音频转换器,但我不能将libFlac C库链接到我的Xcode项目。当我试图这样做,编译器说:
I've decided to write an simple audio converter in objective-c and cocoa, but i cannot link libFlac C library to my Xcode project. When i'm trying to do this, compiler says:
ld:没有为架构x86_64找到符号
ld: symbol(s) not found for architecture x86_64
更重要的是,当我试图通过命令行工具编译它时(就像readme文件中所描述的),terminal throws:
What's more, when i'm trying to compile it via command line tools (just like it is described in readme file), terminal throws:
与之前的存档成员匹配cputype(16777223)(所有成员必须
匹配)ranlib:for architecture:x86_64 file:.libs / libFLAC .a(float.o)
没有符号make [4]: * [libFLAC.la]错误1 make [3]:
[all-recursive ]错误1 make [2]: [all-recursive]错误1 make [1]:
* [all-recursive] Error 1
ot match previous archive members cputype (16777223) (all members must match) ranlib: for architecture: x86_64 file: .libs/libFLAC.a(float.o) has no symbols make[4]: * [libFLAC.la] Error 1 make[3]: [all-recursive] Error 1 make[2]: [all-recursive] Error 1 make[1]: * [all-recursive] Error 1
当我将目标架构改为intel 32位时:
And when I changed target architecture to intel 32-bit:
错误:-fobjc-arc不支持用脆弱abi
命令> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang>失败,退出代码1
error: -fobjc-arc is not supported with fragile abi Command >/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang >failed with exit code 1
有人可以帮助我吗?也许有人知道更好,更容易的解释目标c?中的FLAC文件的方法?
Can anybody help me ? Maybe somebody knows about better, easier way for decoding FLAC files in objective-c ?
推荐答案
./configure --disable-asm-optimizations && make
这将在OS X上正确生成。
This will build correctly on OS X.
这篇关于在Mountain Lion中使用libFlac和Xcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!