这是Boost库中的错误吗 [英] Is this a bug in the boost library

查看:112
本文介绍了这是Boost库中的错误吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用自动工具编译项目,并且正在版本 gcc版本5.3.1 和boost版本 1_63 中使用g ++.在 aclocal autoconf autoheader ,automake --add-missing之后,我用一些选项运行了 configure .成功并生成一个Makefile.运行make失败,并给我错误(摘录):

I'm compiling a project with autotools and am using g++ in version gcc version 5.3.1 and boost version 1_63. After aclocal, autoconf, autoheader, automake --add-missing, I ran configure with some options, which succedded and build make a Makefile. Running make fails and gives me the error (excerpt):

In file included from /usr/local/include/boost/ratio/ratio.hpp:46:0,
             from /usr/local/include/boost/chrono/duration.hpp:41,
             from /usr/local/include/boost/chrono/time_point.hpp:33,
             from /usr/local/include/boost/thread/lock_types.hpp:22,
             from /usr/local/include/boost/thread/pthread/mutex.hpp:16,
             from /usr/local/include/boost/thread/mutex.hpp:16,
             from src/cosupport-initializer/cpp/BasicInitializer.cpp:39:
/usr/local/include/boost/integer_traits.hpp:83:46: error: 'CHAR_MIN' was not declared in this scope
public detail::integer_traits_base<char, CHAR_MIN, CHAR_MAX>
                                          ^
/usr/local/include/boost/integer_traits.hpp:83:56: error: 'CHAR_MAX' was not declared in this scope
public detail::integer_traits_base<char, CHAR_MIN, CHAR_MAX>
                                                    ^
/usr/local/include/boost/integer_traits.hpp:83:64: error: template argument 2 is invalid
public detail::integer_traits_base<char, CHAR_MIN, CHAR_MAX>
                                                            ^
/usr/local/include/boost/integer_traits.hpp:83:64: error: template argument 3 is invalid
/usr/local/include/boost/integer_traits.hpp:89:53: error: 'SCHAR_MIN' was not declared in this scope
public detail::integer_traits_base<signed char, SCHAR_MIN, SCHAR_MAX>
                                                 ^
/usr/local/include/boost/integer_traits.hpp:89:64: error: 'SCHAR_MAX' was not declared in this scope
 public detail::integer_traits_base<signed char, SCHAR_MIN, SCHAR_MAX>
                                                            ^
/usr/local/include/boost/integer_traits.hpp:89:73: error: template argument 2 is invalid
public detail::integer_traits_base<signed char, SCHAR_MIN, SCHAR_MAX>
                                                                     ^
/usr/local/include/boost/integer_traits.hpp:89:73: error: template argument 3 is invalid
/usr/local/include/boost/integer_traits.hpp:95:58: error: 'UCHAR_MAX' was not declared in this scope
public detail::integer_traits_base<unsigned char, 0, UCHAR_MAX>
                                                      ^
/usr/local/include/boost/integer_traits.hpp:95:67: error: template argument 3 is invalid
public detail::integer_traits_base<unsigned char, 0, UCHAR_MAX>
                                                               ^
/usr/local/include/boost/integer_traits.hpp:131:47: error: 'SHRT_MIN' was not declared in this scope
public detail::integer_traits_base<short, SHRT_MIN, SHRT_MAX>
                                           ^
/usr/local/include/boost/integer_traits.hpp:131:57: error: 'SHRT_MAX' was not declared in this scope
public detail::integer_traits_base<short, SHRT_MIN, SHRT_MAX>
                                                     ^
/usr/local/include/boost/integer_traits.hpp:131:65: error: template argument 2 is invalid
public detail::integer_traits_base<short, SHRT_MIN, SHRT_MAX>
                                                             ^
/usr/local/include/boost/integer_traits.hpp:131:65: error: template argument 3 is invalid
/usr/local/include/boost/integer_traits.hpp:137:59: error: 'USHRT_MAX' was not declared in this scope
public detail::integer_traits_base<unsigned short, 0, USHRT_MAX>
                                                       ^
/usr/local/include/boost/integer_traits.hpp:137:68: error: template argument 3 is invalid
public detail::integer_traits_base<unsigned short, 0, USHRT_MAX>
                                                                ^
/usr/local/include/boost/integer_traits.hpp:143:45: error: 'INT_MIN' was not declared in this scope
public detail::integer_traits_base<int, INT_MIN, INT_MAX>
                                         ^
/usr/local/include/boost/integer_traits.hpp:143:54: error: 'INT_MAX' was not declared in this scope
public detail::integer_traits_base<int, INT_MIN, INT_MAX>
                                                  ^
/usr/local/include/boost/integer_traits.hpp:143:61: error: template argument 2 is invalid
public detail::integer_traits_base<int, INT_MIN, INT_MAX>
                                                         ^
/usr/local/include/boost/integer_traits.hpp:143:61: error: template argument 3 is invalid
/usr/local/include/boost/integer_traits.hpp:149:57: error: 'UINT_MAX' was not declared in this scope
public detail::integer_traits_base<unsigned int, 0, UINT_MAX>
                                                     ^
/usr/local/include/boost/integer_traits.hpp:149:65: error: template argument 3 is invalid
public detail::integer_traits_base<unsigned int, 0, UINT_MAX>
                                                             ^
/usr/local/include/boost/integer_traits.hpp:155:46: error: 'LONG_MIN' was not declared in this scope
public detail::integer_traits_base<long, LONG_MIN, LONG_MAX>
                                          ^
/usr/local/include/boost/integer_traits.hpp:155:56: error: 'LONG_MAX' was not declared in this scope
public detail::integer_traits_base<long, LONG_MIN, LONG_MAX>
                                                    ^
/usr/local/include/boost/integer_traits.hpp:155:64: error: template argument 2 is invalid
public detail::integer_traits_base<long, LONG_MIN, LONG_MAX>
                                                            ^
/usr/local/include/boost/integer_traits.hpp:155:64: error: template argument 3 is invalid
/usr/local/include/boost/integer_traits.hpp:161:58: error: 'ULONG_MAX' was not declared in this scope
public detail::integer_traits_base<unsigned long, 0, ULONG_MAX>
                                                      ^
/usr/local/include/boost/integer_traits.hpp:161:67: error: template argument 3 is invalid
public detail::integer_traits_base<unsigned long, 0, ULONG_MAX>

例如在第83行的/usr/local/include/boost/integer_traits.hpp 中,构造函数初始化失败:

This means e.g. that in /usr/local/include/boost/integer_traits.hpp on line 83, the constructor initialization fails:

template<>
class integer_traits<char>
  : public std::numeric_limits<char>,
    public detail::integer_traits_base<char, CHAR_MIN, CHAR_MAX>
{ };

这意味着在文件/usr/local/include/boost/integer_traits.hpp 和其中包含的标头中,没有 CHAR_MIN 的定义.因此,这是增强功能中的错误吗?还是我在这里想念什么?

This means in the file /usr/local/include/boost/integer_traits.hpp and headers included in it, there's no definition of CHAR_MIN. So this is a bug in boost? Or what am I missing here?

更新

相关代码节选.搬家之前:

The relevant code excerpts. Before the move:

#include <CoSupport/compatibility-glue/nullptr.h>
#include <CoSupport/Initializer/BasicInitializer.hpp>
#include <boost/thread/mutex.hpp>
#include <cassert>

namespace CoSupport {
...
}

移动后:

#include <boost/thread/mutex.hpp>
#include <CoSupport/compatibility-glue/nullptr.h>
#include <CoSupport/Initializer/BasicInitializer.hpp>
#include <cassert>

namespace CoSupport {
...
}

推荐答案

这意味着在文件/usr/local/include/boost/integer_traits.hpp 和其中包含的标头中,没有定义 CHAR_MIN

This means in the file /usr/local/include/boost/integer_traits.hpp and headers included in it, there's no definition of CHAR_MIN

应该如此- CHAR_MIN < climits> .

Which is as it should be - CHAR_MIN is defined in <climits>.

那么这是Boost中的错误吗?还是我在这里想念什么?

So this is a bug in boost? Or what am I missing here?

具有99%的确定性,这并不是提升的错误.您可能有一些自己的包含文件,在项目的包含目录中,掩盖了 climits limits.h ,或者还有另一个文件 interger_traits.hpp 包含,并且本身包含 climits limits.h .

With 99% certainty, this is not a bug in boost. You probably have some include files of your own, in your project's include directories, masking climits or limits.h, or possibly another file which interger_traits.hpp includes and itself includes climits or limits.h.

这篇关于这是Boost库中的错误吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆