关于可可应用程序中sox库的运行时错误

时间:2010-03-04 10:57:32

标签: cocoa sox

我正在尝试将库放入我的项目并使用./configure,make和make install安装库,并将libsox.dylib链接到我的项目中。我没有收到编译器错误但导致运行时错误。

现在我收到了以下错误,

[Session started at 2010-03-03 17:33:44 +0530.]
dyld: Library not loaded: /usr/local/lib/libmp3lame.0.dylib
  Referenced from: /usr/local/lib/libavformat.dylib
  Reason: no suitable image found.  Did find:
/usr/local/lib/libmp3lame.0.dylib: mach-o, but wrong architecture
/usr/local/lib/libmp3lame.0.dylib: mach-o, but wrong architecture

The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to signal 5 (SIGTRAP).

所以任何人都请告诉我将sox库安装到mac os中的确切步骤。

此致 CocoaDev

2 个答案:

答案 0 :(得分:1)

您可能尝试混合使用不同的架构,例如32位和64位代码,或x86和ARM。使用file检查dyld的体系结构,并将其与您尝试构建的体系结构进行比较。

$ man file

答案 1 :(得分:0)

以下是快速修复:安装程序时,以这种方式运行“configure”:

./configure CFLAGS='-O2 -arch x86_64 ...' LDFLAGS='-arch x86_64 ...'

列出所有您想要的拱门,每个拱门都有一个单独的-arch。众所周知,这有时会破裂。例如,不要以这种方式编译LibSDL,你将得到不正确的输出(奇怪的颜色和东西)。不幸的是,sox很可能遇到类似的问题,所以一定要在你想要的所有拱门上进行测试。