Boost logo

Boost :

Subject: Re: [boost] Boost Python Xcode Example
From: Jared McIntyre (jmcintyre_at_[hidden])
Date: 2014-05-12 19:00:09


On May 12, 2014, at 2:07 PM, Jared McIntyre <jmcintyre_at_[hidden]> wrote:

> I have been trying to get the Boost Python example working when compiling in Xcode. Everything compiles at the moment, but the module fails to load in python. It fails to find the module if it has an extension of either .pyd or .dylib, and .so has the error "ImportError: dynamic module does not define init function” even though the function should be there. I’m sure that I have something setup incorrectly and was wondering is anyone has a working Xcode project example that I could take a look at to see where I’ve gone wrong.

Sorry to answer my own question, but it turns out the trick was to use a standard dylib generating project and set the output extension to “so”. Python was happy picking this up as a module where it was ignoring both dylib and pyd. The other issue was another oversight in my porting. The text in BOOST_PYTHON_MODULE must match the file name in a case-sensitive manner in OS X, while this requirement is insensitive on Windows. My filesystem is setup case-insensitive, but the sensitive requirement still holds. I didn’t realize this when I was migrating.

Jared


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk