GCC与正弦和Boost的编译误差:间隔



我需要在安装了gcc/g 的Linux(CentOS 6.7(服务器上运行一些代码(7.2.0(和Boost(1.66(( edit:不仅是1.66,较旧版本的Boost干涉。保持机器清洁的家伙(。我用这样的策略指定了我的间隔类型:

// test.cpp
#include <boost/numeric/interval.hpp>   
namespace bn = boost::numeric;
namespace bi = bn::interval_lib;
using Interval = bn::interval<
      double,
      bi::policies<
          bi::save_state<bi::rounded_transc_std<double> >,
          bi::checking_base<double>
      >
  >;

现在我想做一些简单的计算,例如:

// still test.cpp
int main() 
{
    Interval iv_arg {1.0};
    Interval res = sin(iv_arg);
}

在我的本地机器上,用叮当声编译的Mac非常好。但是,一旦我尝试在服务器上运行它,使用g++ -std=c++11 test.cpp编译,我会遇到错误:

/usr/include/boost/numeric/interval/rounded_arith.hpp:71:59:错误: 在此范围内没有宣布" to_int",也没有声明 通过参数依赖性查找在实例上找到 [-fpermissive] t int_down(const t&amp; x({this-> downward((;返回 to_int(x(;} ~~~~~~~~~^~~/usr/include/boost/numeric/interval/rounded_arith.hpp:71:59:注意: 依赖基础的声明 'boost :: numeric :: Interval_lib ::详细信息:: c99_rounding''找不到 不合格的查找 /USR/include/boost/numeric/interval/rounded_arith.hpp:71:59:注意:使用:使用 'this-> to_int'而不是

还有更多与该主题无关的信息,但是如果可能会有所帮助,我可以包括它。我尝试了一些谷歌,但找不到任何相关的东西。如果可能的话,我想找到一个不需要服务器上任何更改的解决方案。有人有一个想法还是在之前遇到类似问题?

编译此编译的第一个版本是1.58

  • Boost 1.57错误
  • Boost 1.58 OK

最新更新