gpt4 book ai didi

c++ - 使用 GCC 4.7.0 构建 Boost 1.49.0 时出错

转载 作者:IT老高 更新时间:2023-10-28 22:33:31 25 4
gpt4 key购买 nike

我正在尝试使用 GCC 4.7.0 (MinGW) 构建 Boost 1.49.0。我不断收到以下错误消息数十次:

c:\tools\mingw\bin../lib/gcc/i686-pc-mingw32/4.7.0/../../../../include/c++/4.7.0/cmath:1096:11: error: '::hypot' has not been declared

cmath 的第 1096 行包含

using ::hypot;

cmath 包括 math.hhypot 函数声明为

extern double __cdecl hypot (double, double); /* in libmoldname.a */

在这两个文件中,在上面引用的几行之后,是 hypotl 函数的相同语句(除了类型是 long double 而不是 double) 并且那个看起来很开心。

知道为什么我会收到此错误吗?

最佳答案

@Praetorian 的回答正确识别了问题。另一方面,Python header 在技术上意味着排在任何其他 header 之前。此外,有时接受的解决方案在构建系统中不起作用或不方便,因此我想出了一个替代解决方案。将以下标志添加到对 g++ 的调用中:

-D_hypot=hypot

这使得 Python 头文件中的有害宏变为空操作,编译错误消失。

关于c++ - 使用 GCC 4.7.0 构建 Boost 1.49.0 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10660524/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com