[Pyrex] C++ wrapping tutorial

David McNab david at rebirthing.co.nz
Wed Nov 7 00:58:57 CET 2007


On Wed, 2007-11-07 at 11:47 +1300, Greg Ewing wrote:
> David McNab wrote:
> 
> > I've posted on the wiki a short tutorial on using Pyrex/Cython to wrap
> > C++ classes:
> 
> Regarding "Access to C-only functions", you say that it's
> necessary to write C++ wrappers to call the C functions.
> 
> I don't see why that should be necessary as long as the
> declarations are in an "extern from" block and the header
> file encloses them in 'extern "C"'.

True - if the header file does this, then no problem.

I'm thinking more of C-only libs.

Cheers
David

>  Then the C++ compiler
> will know that they are C functions and generate the
> appropriate linkage for calls to them.
> 
> --
> Greg
> 




More information about the Pyrex mailing list