[Pyrex] C++ wrapping tutorial

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 7 23:21:57 CET 2007


David McNab wrote:
> I'm thinking more of C-only libs.

Even then, all you need to do is create a .h file
that has an extern "C" and includes the C++ header.
You shouldn't have to write any wrapping code.

Another way to think about this is that when
operating in C++ mode, Pyrex expects all the
included headers to be C++ headers. Any plain
C headers need to be wrapped in extern "C" to
turn them into C++ headers.

Thanks for writing this, BTW -- it's good to
have somewhere to send people who want to know
about using Pyrex with C++. I'll get a link
onto the Pyrex page soon.

--
Greg



More information about the Pyrex mailing list