After having some trouble trying to embed Python into my program using #include <Python.h>, I finally got it to find all the correct libraries, but I have another error. When I try to compile with #include <Python.h> it redirects me to cmath in my code::blocks directory, and puts an error marker by the line that says using ::hypot; and says: error: '::hypot' has not been declared. I have no idea why this is an error, especially because this came with my code::blocks installation, and came up, I assume, because Python tried to include it. I am on Windows, and using the newest version of Python (3.4.2)
-
1Related - stackoverflow.com/a/12124708/241631Praetorian– Praetorian2015年02月23日 21:09:56 +00:00Commented Feb 23, 2015 at 21:09
1 Answer 1
Try adding
#include <cmath>
before including Python when compiling.
Your error is a result of hypot being renamed to _hypot in your pyconfig header file. cmath is expecting to see hypot and not _hypot.
1 Comment
#include <Python.h> before anything else