Making a python extension in c++

Erik Weber erikw at lineo.com
Tue Apr 24 12:37:49 EDT 2001


Hmmm.  This is true, but I am thinking this is a failure of the
Makefile.pre.in script to handle the extension ".cc"

--
  -Erik Weber
   Lineo Seattle
   206.285.2506 x204

"Aaron Drew" <nospam at nospam.com> wrote in message
news:3ae58431 at news.iprimus.com.au...
> Symbolic symbols for C and C++ differ a great deal. You have to declare
your
> functions extern "C" in C++ if you want them to be callable from both C
and
> C++ files.
>
>
>
> "Erik Weber" <erikw at lineo.com> wrote in message
> news:988067008.220977 at db.lineo.com...
> > I am attempting to make a Python-2.0 extension on Linux.  If I include
in
> > Setup the lines
> >
> > *shared*
> > test test.c
> >
> > it compiles test.so no problem.  If however I use the lines
> >
> > *shared*
> > test test.cc
> >
> > then the build fails with;
> >
> > [erikw at devbrick4 testwiz]$ make
> >
>
fpic  -g -O2 -Wall -Wstrict-prototypes -I/usr/local/include/python2.0 -I/usr
> > /loc
> > al/include/python2.0 -DHAVE_CONFIG_H -c ./test.cc
> > make: fpic: Command not found
> > make: [test.o] Error 127 (ignored)
> > gcc -shared  test.o  -o test.so
> > gcc: test.o: No such file or directory
> > gcc: No input files
> > make: *** [test.so] Error 1
> > [erikw at devbrick4 testwiz]$
> >
> > It seems to me as though the ".cc" extension causes the Makefile.pre.in
> > stuff to fail.  Has anyone compiled a C++ based extension?  If so, what
> did
> > your Setup file look like?
> >
> > --
> >   -Erik Weber
> >    Lineo Seattle
> >    206.285.2506 x204
> >
> >
> >
> >
> >
>
>






More information about the Python-list mailing list