On Wed, Oct 3, 2012 at 7:21 AM, Brad Buran <bbu...@gmail.com> wrote:Wow! this is pretty painful for a binary-only proprietary library (I'm
> I'm trying to write a Cython wrapper around a library for reading from a
> (proprietary) binary file format. The vendor has released versions of the
> library (called "MCStream" on Linux and "MC_StreamAnsiLib" on Windows)
> compiled for Linux and Windows. I've been able to successfully get the
> Cython wrapper working under Linux; however, the version of the vendor's
> library for Windows is linked against the boost C++ library. Hence, I need
> to compile the boost library on Windows for linking.
assuming you do not get the source code so that you could re-compile
the lib yourself?)
> I was able to successfully do this and compile/link a test C++ file with thethat does seem likely but probaly not your issue anyway...
> MCStream library and the boost libraries, but only when using Microsoft
> Visual Studio 10. Based on what I understand from various newsgroups, the
> boost library must be compiled/linked using the same version of MS Visual
> Studio that MCStream was compiled under.
> However, I understand that Cython uses Visual Studio 9 (at least that's theTo be clear, it is not Cython that uses an particular version of a
> default executable used when I run "python setup.py build_ext --inplace").
compiler, it is distutils, which is designed to compile Python
extensions with the same compiler that python itself was built with.
The Python binaries distributed by python.org were built with
particular versions (usually a bit old) 2.7 was built with VS2008, for
instance (is that the same as 9? -- the dula naming conversion drives
> Consequently, I get a lot of "unresolved external symbol" errors that areHMM -- if I have this right: MCStream uses Boost (or some of it,
> associated with the failure to properly link the boost libraries with the
> MCStream executable.
anyway). But that should be independent of your Cython code -- it
should be calling the MCStream API directly (or are there data types,
etc, provided by Boost that you need to use to call MCStream?)
Anyway -- while distutils, by default, uses the compiler PYthon was
I'm not sure how to force distutils to use a different one, but I'd
You may also be abel to make a little layer: put the boost stuff in a
A final option is to re-compile Python itself with VS 9 -- then it'll
> below, actual error is at the bottom). As you can see, the error relates toI don't know if minGW is ABI-compatible with MS VS for C++ (it does
> it being unable to find the references defined in the MCStream library;
work for C, but there is no standard ABI for C++)
Christopher Barker, Ph.D.
Emergency Response Division
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.