error: '::hypot' has not been declared

原文:https://blog.csdn.net/weixin_37993251/article/details/88054384

是在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文件


3. 在文件头添加
#define _hypot hypot
4. 保存并重新运行

猜你喜欢

转载自www.cnblogs.com/hichens/p/11595583.html