Request: could someone post a recipe, from top to bottom, for creating an Xcode project that will compile C code to build a Python extension? I've seen several posts here that touch upon the subject, but they seem confusing and incomplete, and they disagree.
Specific questions:
Can Mac Python 2.7 load a .dylib? Mine coldly ignores them.
Can one really solve the problem by renaming a .dylib to a .so filename extension? Various posts disagree on this question.
- Are .dylib and .so actually different formats? Are there settings I could make in Xcode to make it output a true .so format?
If Python is failing to load an extension file, are there tools to diagnose it? Is there any way to poke into the file, look at its format, and see if it does or does not match what is needed?
When I renamed my .dylib to .so, I got the following error message:
ImportError: dlopen(/Library/Python/2.7/site-packages/pypower.so, 2): no suitable image found. Did find: /Library/Python/2.7/site-packages/pypower.so: mach-o, but wrong architecture
My project is targeted to "32-bit Intel" architecture. And I really need to use 32-bit, because of some of the old libraries I'm linking to. Is Python going to have a problem loading a 32-bit library? Is there a way to bridge the gap?