如何为不同的架构构建mach-0?
我有一些 dylibs 可以用 ctypes 从 python 加载。我可以毫无问题地加载libbass.dylib,但无法加载自编译的libmp3lame.dylib。这是我得到的错误。
操作系统错误:dlopen(libmp3lame.dylib,6): 没有找到合适的图片。是否发现: libmp3lame.dylib:mach-o,但错误 架构
,我检查这些库的文件类型。这是 libbass.dylib 的结果:
libbass.dylib: Mach-O universal binary with 2 architectures
libbass.dylib (for architecture i386): Mach-O dynamically linked shared library i386
libbass.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc
这是自编译的:
libmp3lame.dylib: Mach-O 64-bit dynamically linked shared library x86_64
我确实使用安装说明编译了 lame 库:
./configure
make
make install
我是 mac 系统的新手,问题来了:如何构建 libmp3lame.dylib 所以它支持我想要的不同架构?
谢谢。
I have some dylibs to load from python with ctypes. I can load libbass.dylib without problem, but I can't load the self-compiled libmp3lame.dylib. Here is the error I get.
OSError: dlopen(libmp3lame.dylib, 6):
no suitable image found. Did find:
libmp3lame.dylib: mach-o, but wrong
architecture
Then, I inspect the file type of those libs. Here is the result of libbass.dylib:
libbass.dylib: Mach-O universal binary with 2 architectures
libbass.dylib (for architecture i386): Mach-O dynamically linked shared library i386
libbass.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc
And here is the self-compiled one:
libmp3lame.dylib: Mach-O 64-bit dynamically linked shared library x86_64
I did compile the lame library with the install instructions:
./configure
make
make install
I'm new to mac system, here comes the problem: how to build the libmp3lame.dylib so that it supports different architecture I want?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需运行:
有关详细信息,请参阅 http://developer.apple。 com/library/mac/#technotes/tn2005/tn2137.html
Just run:
For further information, see http://developer.apple.com/library/mac/#technotes/tn2005/tn2137.html