osdir.com
mailing list archive

Subject: c++ patch usage - msg#00000

List: python.pyrex

Date: Next Index Thread: Next Index
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)

nsz


Was this page helpful?
Yes No
Thread at a glance:

Next Message by Date: click to view message preview

Re: c++ patch usage

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@xxxxxxxxx> 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)

Next Message by Thread: click to view message preview

Re: c++ patch usage

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@xxxxxxxxx> 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)
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by