Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'::hypot' has not been declared

I'm using python3.6 theano, with mingw-w64-x86-64 installed, my os is Win10_64, cuda installed, and seems everything is ok

the theano.test() is ok, saying my gpu is working,

but it just keeps tell me that "error: '::hypot' has not been declared"

 C:/mingw64/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/cmath:1157:11: error: '::hypot' has 
 not been declared\r.    using ::hypot;\r.            ^~~~~\r. ", 

Any help would be appreciated!

like image 356
YJHMITWEB Avatar asked Feb 16 '17 14:02

YJHMITWEB


3 Answers

I had this error with building an python file using mingw32 . I opened the file that it says (C:/mingw64/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/cmath:1157:11)
and changed that line to

using ::_hypot;

or adding this line just before that :

#define hypot _hypot

and after that the problem was solved !! I know it's not a basic solution but it is the one that I could find !!

like image 132
it_nazanin Avatar answered Oct 16 '22 21:10

it_nazanin


(This answer was posted in comments originally)

I had to keep the original mingw cmath header (otherwise libpng would not build) and I commented out the #define hypot _hypot in pyconfig.h (line 241).

like image 32
M.M Avatar answered Oct 16 '22 23:10

M.M


What worked for me was to use the combination of the answers above:

#ifdef _WIN64
#define _hypot hypot
#include <cmath>
#endif
#include <pybind11.h>
like image 1
Adam Husár Avatar answered Oct 16 '22 21:10

Adam Husár