0

使用 gcc 8.3.0 编译我的应用程序时出现以下错误

In file included from /usr/include/x86_64-linux-gnu/c++/8/bits/c++allocator.h:33,
                 from /usr/include/c++/8/bits/allocator.h:46,
                 from /usr/include/c++/8/string:41,
                 from base_types.hpp:13,
                 from queues.hpp:11,
                 from data_processing_thread.hpp:12,
                 from data_processing_thread.cpp:10:
/usr/include/c++/8/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::destroy(_Up*) [with _Up = unsigned char [1024]; _Tp = std::_List_node<unsigned char [1024]>]’:
/usr/include/c++/8/bits/alloc_traits.h:487:4:   required from ‘static void std::allocator_traits<std::allocator<_CharT> >::destroy(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*) [with _Up = unsigned char [1024]; _Tp = std::_List_node<unsigned char [1024]>; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<std::_List_node<unsigned char [1024]> >]’
/usr/include/c++/8/bits/list.tcc:77:31:   required from ‘void std::__cxx11::_List_base<_Tp, _Alloc>::_M_clear() [with _Tp = unsigned char [1024]; _Alloc = std::allocator<unsigned char [1024]>]’
/usr/include/c++/8/bits/stl_list.h:507:9:   required from ‘std::__cxx11::_List_base<_Tp, _Alloc>::~_List_base() [with _Tp = unsigned char [1024]; _Alloc = std::allocator<unsigned char [1024]>]’
/usr/include/c++/8/bits/stl_list.h:681:7:   required from here
/usr/include/c++/8/ext/new_allocator.h:140:28: error: request for member ‘~unsigned char [1024]’ in ‘* __p’, which is of non-class type ‘unsigned char [1024]’
  destroy(_Up* __p) { __p->~_Up(); }
                      ~~~~~~^~~
Makefile:19: recipe for target 'obj/data_processing_thread.o' failed

base_types.hpp 的第 13 行,这是我的代码的第一行,其中错误堆栈上只是一个包含语句:

#include <string>

所以我不确定这是在哪里或为什么会中断。谢谢

4

0 回答 0