[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

Ralf Schmitt report at bugs.python.org
Wed Mar 16 00:39:16 CET 2011


New submission from Ralf Schmitt <schmir at gmail.com>:

The following program

#include <Python.h>
#include <cmath>

results in the following error when compiled with g++ and -std=gnu++0x:

$ g++ -std=gnu++0x -c t.cc -I /c/Python27/Include
In file included from c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.5.1/include/c++/cmath:629:0,
                 from t.cc:2:
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.5.1/include/c++/tr1_impl/cmath:203:11: error: '::hypot' has not been declared

The problem is, that pyconfig.h has the following define:

#define hypot _hypot

It should probably just be removed when using gcc.

----------
components: None
messages: 131067
nosy: schmir
priority: normal
severity: normal
status: open
title: hypot define in pyconfig.h clashes with g++'s cmath
type: compile error
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11566>
_______________________________________


More information about the Python-bugs-list mailing list