在嘗試使用#include <Python.h>
將Python嵌入到我的程序中出現問題後,我終於找到它來找到所有正確的庫,但是我有另一個錯誤。當我嘗試使用#include <Python.h>
進行編譯時,它將我重定向到我的code :: blocks目錄中的cmath,並將一個錯誤標記放在using ::hypot;
這一行,並說:error: '::hypot' has not been declared
。我不知道爲什麼這是一個錯誤,特別是因爲這是與我的code :: blocks安裝一起發生的,而且我猜想,因爲Python試圖包含它。我在Windows上,並使用Python的最新版本(3.4.2)「Error:'hypot'has not declare」in cmath while try to嵌入Python
2
A
回答
10
嘗試增加
#include <cmath>
包括Python編譯時之前。
您的錯誤是由於hypot
被重命名爲_hypot
而造成的pyconfig頭文件。 cmath期待看到hypot
而不是_hypot
。
+0
謝謝,它完美的作品!奇怪的是,在文檔中,它說你應該把#include
相關問題
- 1. java while while try catch,can not print to a new line
- 2. LINQ to SQL in and not in
- 3. while foreach while while in php does not work
- 4. LINQ to Entity,加入NOT IN表
- 5. LINQ to Objects - NOT IN查詢
- 6. Python while/try/if循環
- 7. null to listOf(),not null to listOf(value)in Kotlin in one liner?
- 8. Javascript var is not loading in facebook post to feed
- 9. if else not in php [嵌套]
- 10. RGB to VIBGYOR in python
- 11. UnicodeDecodeError while Image Processing in Python
- 12. AssertTrue in try/catch
- 13. Can not get canvas to draw fig in matplotlib
- 14. LINQ to SQL class not shown in VS
- 15. LINQ to Entities中的「NOT IN」子句
- 16. In can not be resolved to a type
- 17. Try Catch not working?
- 18. Try/catch in PHP
- 19. Django internationalization not working while while DEBUG = True in zinnia博客應用程序
- 20. Double While while not working
- 21. while while while not working properly
- 22. While loop not breaking
- 23. 「Binary XML file android.widget.ProgressBar can not to cast to android.view.ViewGroup」in progress bar
- 24. Python 3嵌套While循環
- 25. Toast in Try/Catch numberformatexception
- 26. while循環忽略try-catch
- 27. while loop not ended
- 28. Font not not in DOMPDF
- 29. Try Catch does not catch
- 30. 嵌套while和for在Python
相關 - https://stackoverflow.com/a/12124708/241631 – Praetorian 2015-02-23 21:09:56