error: '::hypot' has not been declared

是在pip install pyamg时候报错c:\tools\mingw\bin../lib/gcc/i686-pc-mingw32/4.7.0/../../../../include/c++/x.x.x/cmath:1096:11:error: '::hypot' has not been declared 

error: command 'C:\\Program Files\\mingw-w64\\x86_64-7.1.0-posix-seh-rt_v5-rev2\\mingw64\\bin\\gcc.exe' failed with exit status 1


这里根本原因是因为在pyconfig.h 中定义hypot as _hypot,所以解决方法是

1. 找到你的mingw64文件夹下路径C:\Program Files\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev2\mingw64\lib\gcc\x86_64-w64-mingw32\7.1.0\include\c++

2. 找到cmath文件

error: '::hypot' has not been declared_第1张图片

3. 在文件头添加

#define _hypot hypot

4. 保存并重新运行

 

参考:

http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-td3165793.html#a3166757

https://stackoverflow.com/questions/10660524/error-building-boost-1-49-0-with-gcc-4-7-0/12124708#12124708

你可能感兴趣的:(error: '::hypot' has not been declared)