[Pyrex] [Cython-dev] 'cdef public' functions with a C++ compiler

Robert Bradshaw robertwb at math.washington.edu
Tue Dec 11 03:38:44 CET 2007


It looks like this is a bug, and since we haven't done anything with  
this part of the code (as far as I know) it would be a bug in Pyrex  
too. However, we have several C++ files that compile fine with g++,  
so more details would be needed to reproduce this.

- Robert

On Dec 10, 2007, at 3:48 PM, Matthew Woodcraft wrote:

> I'm trying to define a public function in a Cython module which is  
> being
> compiled with a C++ compiler. For example, if I have a file containing
> just the following:
>
> cdef public void xxx():
>     pass
>
> I get the following error from g++ (with cython-0.9.6.9):
>
> demo.cpp: In function 'void xxx()':
> demo.cpp:95: error: previous declaration of 'void xxx()' with 'C++'  
> linkage
> demo.cpp:105: error: conflicts with new declaration with 'C' linkage
>
> It seems that Cython is putting __PYX_EXTERN_C around the  
> definition of
> the function but not around the declaration.
>
> Is this something that isn't supposed to work, or am I doing it wrong,
> or is it a bug?
>
> -M-
>
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/cython-dev




More information about the Pyrex mailing list