gitaaronc/autohubpp

error: ‘using allocator_type = class std::allocator<void> {aka class std::allocator<void>}’ has no member named ‘destroy’

Closed this issue · 3 comments


SerialPort.cpp:149:63: required from here
/usr/include/c++/5/bits/alloc_traits.h:530:4: error: ‘using allocator_type = class std::allocator {aka class std::allocator}’ has no member named ‘construct’
{ __a.construct(__p, std::forward<_Args>(__args)...); }
^
/usr/include/c++/5/bits/alloc_traits.h: In instantiation of ‘static void std::allocator_traits<std::allocator<_CharT> >::destroy(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*) [with _Up = std::promise; _Tp = void; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator]’:
/usr/include/c++/5/bits/shared_ptr_base.h:531:35: required from ‘void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_dispose() [with _Tp = std::promise; _Alloc = std::allocator; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’
SerialPort.cpp:218:1: required from here
/usr/include/c++/5/bits/alloc_traits.h:542:4: error: ‘using allocator_type = class std::allocator {aka class std::allocator}’ has no member named ‘destroy’
{ __a.destroy(__p); }

What version of gcc do you have?
gcc -v
I am using gcc version 6.3.0 20170516 (Debian 6.3.0-18)

Also, what version of boost do you have installed?
dpkg -s libboost-dev | grep 'Version'
I have Version: 1.62.01 currently. Are you using the Netbeans project file? If not, be sure to specify c++11 or greater when compiling. This should already be set if using the Netbeans project.

Same user: different login.
marius@HPP:$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1
16.04.9) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

marius@HPP:$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1
16.04.9) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

marius@HPP:$ dpkg -s libboost-dev | grep 'Version'7
marius@HPP:
$ dpkg -s libboost-dev | grep 'Version'
Version: 1.58.0.1ubuntu1
marius@HPP:~$

Looks like you need to update gcc.