简体   繁体   English

Snow Leopard上的python / c ++包装

[英]python/c++ wrapping on Snow Leopard

I create a dynamic library and then using swig under snow leopard but when I import my module it returns always ImportError: No module named blabla. 我创建了一个动态库,然后在雪豹下使用swig,但是在导入模块时,它始终返回ImportError:没有名为blabla的模块。 I've all compiled in 64 bit, download and install python 2.7 64 bit. 我全部使用64位编译,下载并安装python 2.7 64位。 This test library has been created with cmake, and when I was with leopard 32 bit, it worked. 这个测试库是使用cmake创建的,当我使用32位豹子时,它可以工作。

Given that it worked on 32 bits, I would first check whether the library has 64 bits code. 鉴于它可以在32位上工作,因此我将首先检查该库是否具有64位代码。 You can use the file command I think to check the arch in a multi-arch mach-o binary. 您可以使用我认为的文件命令来检查多拱型mach-o二进制文件中的拱。

If the library is indeed 64 bits, then please give us the exact exception in python, and more importantly, a build log from cmake. 如果该库确实是64位的,那么请给我们python中的确切异常,更重要的是,请给出来自cmake的构建日志。 Build issues for python extensions on mac are quite tricky because of the multi-arch support, and some incompatibilities between gcc versions, hence the need for more details. 由于多体系结构支持以及gcc版本之间的某些不兼容性,因此在Mac上python扩展的构建问题非常棘手。因此,需要更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM