2015-03-08 2 views
0

Я пытаюсь скомпилировать мою программу, которая использует Boost library 1.57. На Debian Jessie 64bit работает без проблем, но на Debian Squeeze 64bit он показывает следующие ошибки:Ошибки в boost :: shared_ptr.hpp

In file included from /usr/local/include/boost/detail/sp_typeinfo.hpp:20:0, 
       from /usr/local/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:27, 
       from /usr/local/include/boost/smart_ptr/detail/sp_counted_base.hpp:42, 
       from /usr/local/include/boost/smart_ptr/detail/shared_count.hpp:29, 
       from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:28, 
       from /usr/local/include/boost/shared_ptr.hpp:17, 
       from core.h:40, 
       from ai.cpp:1: 
/usr/local/include/boost/core/typeinfo.hpp:138:51: error: ‘boost::{anonymous}::demangled_name’ declared as an ‘inline’ variable 
inline std::string demangled_name(core::typeinfo const & ti) 
               ^
/usr/local/include/boost/core/typeinfo.hpp:138:40: error: ‘::typeinfo’ has not been declared 
inline std::string demangled_name(core::typeinfo const & ti) 
             ^
/usr/local/include/boost/core/typeinfo.hpp:138:40: note: suggested alternatives: 
/usr/local/include/boost/core/typeinfo.hpp:134:24: note: ‘boost::{anonymous}::typeinfo’ 
typedef std::type_info typeinfo; 
         ^
/usr/local/include/boost/core/typeinfo.hpp:134:24: note: ‘boost::{anonymous}::typeinfo’ 
/usr/local/include/boost/core/typeinfo.hpp:139:1: error: expected ‘,’ or ‘;’ before ‘{’ token 
{ 
^ 
In file included from /usr/local/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:27:0, 
       from /usr/local/include/boost/smart_ptr/detail/sp_counted_base.hpp:42, 
       from /usr/local/include/boost/smart_ptr/detail/shared_count.hpp:29, 
       from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:28, 
       from /usr/local/include/boost/shared_ptr.hpp:17, 
       from core.h:40, 
       from ai.cpp:1: 
/usr/local/include/boost/detail/sp_typeinfo.hpp:28:20: error: expected unqualified-id before ‘::’ token 
typedef boost::core::typeinfo sp_typeinfo; 
        ^
In file included from /usr/local/include/boost/smart_ptr/detail/sp_counted_base.hpp:42:0, 
       from /usr/local/include/boost/smart_ptr/detail/shared_count.hpp:29, 
       from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:28, 
       from /usr/local/include/boost/shared_ptr.hpp:17, 
       from core.h:40, 
       from ai.cpp:1: 
/usr/local/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:129:45: error: ‘get_deleter’ declared as a ‘virtual’ field 
    virtual void * get_deleter(sp_typeinfo const & ti) = 0; 
              ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:129:20: error: expected ‘;’ at end of member declaration 
    virtual void * get_deleter(sp_typeinfo const & ti) = 0; 
        ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:129:45: error: expected ‘)’ before ‘const’ 
    virtual void * get_deleter(sp_typeinfo const & ti) = 0; 
              ^
In file included from /usr/local/include/boost/smart_ptr/detail/shared_count.hpp:30:0, 
       from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:28, 
       from /usr/local/include/boost/shared_ptr.hpp:17, 
       from core.h:40, 
       from ai.cpp:1: 
/usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:81:53: error: ‘get_deleter’ declared as a ‘virtual’ field 
    virtual void * get_deleter(detail::sp_typeinfo const &) 
                ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:81:20: error: expected ‘;’ at end of member declaration 
    virtual void * get_deleter(detail::sp_typeinfo const &) 
        ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:81:53: error: expected ‘)’ before ‘const’ 
    virtual void * get_deleter(detail::sp_typeinfo const &) 
                ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:156:53: error: ‘get_deleter’ declared as a ‘virtual’ field 
    virtual void * get_deleter(detail::sp_typeinfo const & ti) 
                ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:156:20: error: expected ‘;’ at end of member declaration 
    virtual void * get_deleter(detail::sp_typeinfo const & ti) 
        ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:156:53: error: expected ‘)’ before ‘const’ 
    virtual void * get_deleter(detail::sp_typeinfo const & ti) 
                ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:252:53: error: ‘get_deleter’ declared as a ‘virtual’ field 
    virtual void * get_deleter(detail::sp_typeinfo const & ti) 
                ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:252:20: error: expected ‘;’ at end of member declaration 
    virtual void * get_deleter(detail::sp_typeinfo const & ti) 
        ^
/usr/local/include/boost/smart_ptr/detail/sp_counted_impl.hpp:252:53: error: expected ‘)’ before ‘const’ 
    virtual void * get_deleter(detail::sp_typeinfo const & ti) 
                ^
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:28:0, 
       from /usr/local/include/boost/shared_ptr.hpp:17, 
       from core.h:40, 
       from ai.cpp:1: 
/usr/local/include/boost/smart_ptr/detail/shared_count.hpp:518:12: error: expected ‘;’ at end of member declaration 
    void * get_deleter(sp_typeinfo const & ti) const 
      ^
/usr/local/include/boost/smart_ptr/detail/shared_count.hpp:518:37: error: expected ‘)’ before ‘const’ 
    void * get_deleter(sp_typeinfo const & ti) const 
            ^
In file included from /usr/local/include/boost/shared_ptr.hpp:17:0, 
       from core.h:40, 
       from ai.cpp:1: 
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:695:12: error: expected ‘;’ at end of member declaration 
    void * _internal_get_deleter(boost::detail::sp_typeinfo const & ti) const BOOST_NOEXCEPT 
      ^
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:695:62: error: expected ‘)’ before ‘const’ 
    void * _internal_get_deleter(boost::detail::sp_typeinfo const & ti) const BOOST_NOEXCEPT 
                  ^
make: *** [ai.o] Error 1 

В моей программной строке 40 файла core.h просто:

#include <boost/shared_ptr.hpp> 

I компилируем это с помощью g ++ 4.9.2 (с флагом std = C++ 11).

Я думаю, что Boost был установлен правильно, потому что когда я запускаю «./b2 install», он не показывает никаких неудачных целей.

  • Знаете ли вы, что могло пойти не так?
+2

Можете ли вы упростить: работает ли файл cpp с включенным включением? Какое наименьшее количество вещей, чтобы заставить его потерпеть неудачу? – Yakk

ответ

0

Так я узнал, что у меня есть заголовок охранник:

#ifndef core 
#define core 

удаления или переименования это решило проблему.

Смежные вопросы