[Pyrex] c++ patch usage

Lenard Lindstrom len-l at telus.net
Thu Feb 2 18:45:26 CET 2006


distutils was something I did not want to touch. I explicitly 
compiled the Pyrex .pyx file using pyrexc, renamed the .c file to 
.cpp, then used distutils to compile the .cpp file.

Anyways, that said, to get rid of the extra 'extern "C"' added by the 
--swig-cpp option comment out line 61

            self.c_to_cpp(target)

of Pyrex/Distutils/build_ext.py. distutils now builds pyxtest.pyx.

Lenard Lindstrom
<len-l at telus.net>

On 2 Feb 2006 at 2:27, Szabolcs Nagy wrote:

> Hello
> 
> I tried the c++ patch and had a little problem with it.
> 
> I used the test (cpptest.pyx), but pyrex still produce a .c file so
> it's compiled as C code thus gcc fails.
> 
> I know I should tell pyrex that i want .cpp instead .c and I thought
> maybe a '--swig-cpp' option would work, but in this case Pyrex added
> an extra 'extern "C" {' to the begining of the file for some reason
> (so gcc failed again because the cpp header included after the extern
> "C" declaration).
> 
> How should i use the pyrex c++ patch?
> (Sorry, I couldn't find any docs on it)




More information about the Pyrex mailing list