[Distutils] changing default compiler
M.-A. Lemburg
mal@lemburg.com
Wed Feb 7 13:59:42 2001
Enrico Sirola wrote:
>
> Hello,
> i wrote a C++ extention module, but distutils keep trying to compile
> it as a plain C interface one. Is t possible it's confused by my
> strange platform name?
>
> from sys import platform
> print platform
>
> gives out
>
> linux2
>
> This is prolly non standard, but maybe it's becouse i'm using a beta
> distro (progeny debian)...
> Anyway everithing works if i run compiler commands by hand (changing
> gcc to g++) and finally type "python setup.py install".
> So, how can i force distutils to use g++ instead of gcc?
Try the --compiler option to the build_ext command. Note that
build_ext is not yet up to compiling C++ code. For gcc a simple
renaming of the source file to .cc or .cxx will let gcc compile
the file as C++ without any additional options.
--
Marc-Andre Lemburg
______________________________________________________________________
Company: http://www.egenix.com/
Consulting: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/