[Cython] cython 0.15 breaks callback code.

Robert Bradshaw robertwb at math.washington.edu
Fri Sep 23 06:56:13 CEST 2011


On Wed, Sep 21, 2011 at 2:54 AM, Brett Calcott <brett.calcott at gmail.com> wrote:
> Hi. I've just reverted to 0.14.1 because 0.15 breaks code that implements a
> cpp callback in python. It seems to be a name-mangling problem.
> I've attached a short test case that shows the problem. They both compile
> fine on 14.1 and 15. But if I try and run the 15 compiled version I get
> this:
> Traceback (most recent call last):
>   File "try_hello.py", line 1, in <module>
>     import test
> ImportError:
> dlopen(/Users/brett/Dropbox/Code/kli-project/cython-test/test.so, 2): Symbol
> not found: __Z19callback_test_helloP7_objecti
>   Referenced from: /Users/brett/Dropbox/Code/kli-project/cython-test/test.so
>   Expected in: dynamic lookup
> Is there anything new I should be doing?

This is probably
https://github.com/cython/cython/commit/c9765a85e1f11a61c604890435b8cebdd49e4cca
which means your declaration of callback_test_hello in callbacks.cpp
also needs to be extern "c" to have the same (i.e. no) mangling.

- Robert


More information about the cython-devel mailing list