[Python-Dev] Maybe we should have a C++ extension for testing...

skip at pobox.com skip at pobox.com
Wed Sep 13 19:46:39 CEST 2006

Building Python with C and then linking in extensions written in or wrapped
with C++ can present problems, at least in some situations.  I don't know if
it's kosher to build that way, but folks do.  We're bumping into such
problems at work using Solaris 10 and Python 2.4 (building matplotlib, which
is largely written in C++), and it appears others have similar problems:


I attached a comment to the third item yesterday (even though it was

One of our C++ gurus (that's definitely not me!) patched the Python source
to include <wchar.h> at the top of Python.h.  That seems to have solved our
problems, but seems to be a symptomatic fix.  I got to thinking, should we
a) encourage people to compile Python with a C++ compiler if most/all of
their extensions are written in C++ anyway (does that even work if one or
more extensions are written in C?), or b) should the standard distribution
maybe include a toy extension written in C++ whose sole purpose is to test
for cross-language problems?

Either/or/neither/something else?


More information about the Python-Dev mailing list