lbryio / lbrycrd

The blockchain that provides the digital content namespace for the LBRY protocol
https://lbry.com
MIT License
2.57k stars 178 forks source link

compiling fails on debian 11 #412

Closed cipig closed 1 year ago

cipig commented 2 years ago
httpserver.cpp:74:10: error: ‘deque’ in namespace ‘std’ does not name a template type
   74 |     std::deque<std::unique_ptr<WorkItem>> queue;
      |          ^~~~~
httpserver.cpp:33:1: note: ‘std::deque’ is defined in header ‘<deque>’; did you forget to ‘#include <deque>’?
   32 | #include <support/events.h>
  +++ |+#include <deque>
   33 | 
httpserver.cpp: In member function ‘bool WorkQueue<WorkItem>::Enqueue(WorkItem*)’:
httpserver.cpp:92:13: error: ‘queue’ was not declared in this scope; did you mean ‘Enqueue’?
   92 |         if (queue.size() >= maxDepth) {
      |             ^~~~~
      |             Enqueue
httpserver.cpp:95:9: error: ‘queue’ was not declared in this scope; did you mean ‘Enqueue’?
   95 |         queue.emplace_back(std::unique_ptr<WorkItem>(item));
      |         ^~~~~
      |         Enqueue
httpserver.cpp: In member function ‘void WorkQueue<WorkItem>::Run()’:
httpserver.cpp:106:35: error: ‘queue’ was not declared in this scope; did you mean ‘Enqueue’?
  106 |                 while (running && queue.empty())
      |                                   ^~~~~
      |                                   Enqueue
httpserver.cpp:110:31: error: ‘queue’ was not declared in this scope; did you mean ‘Enqueue’?
  110 |                 i = std::move(queue.front());
      |                               ^~~~~
      |                               Enqueue

this can be fixed by adding #include <deque> to src/httpserver.cpp

then it fails here, related to boost... boost version in debian 11 is 1.74.0

In file included from /usr/include/boost/type_traits/is_convertible.hpp:20,
                 from /usr/include/boost/iterator/interoperable.hpp:13,
                 from /usr/include/boost/iterator/iterator_facade.hpp:11,
                 from /usr/include/boost/filesystem/path.hpp:29,
                 from /usr/include/boost/filesystem.hpp:16,
                 from ./fs.h:11,
                 from ./dbwrapper.h:9,
                 from ./claimtrie.h:7,
                 from prefixtrie.cpp:2:
/usr/include/boost/interprocess/segment_manager.hpp: In instantiation of ‘boost::interprocess::segment_manager<CharType, MemoryAlgorithm, IndexType>::segment_manager(boost::interprocess::segment_manager<CharType, MemoryAlgorithm, IndexType>::size_type) [with CharType = char; MemoryAlgorithm = boost::interprocess::rbtree_best_fit<boost::interprocess::null_mutex_family>; IndexType = boost::interprocess::null_index; boost::interprocess::segment_manager<CharType, MemoryAlgorithm, IndexType>::size_type = long unsigned int]’:
/usr/include/boost/interprocess/detail/managed_memory_impl.hpp:181:28:   required from ‘bool boost::interprocess::ipcdetail::basic_managed_memory_impl<CharType, MemoryAlgorithm, IndexType, Offset>::create_impl(void*, boost::interprocess::ipcdetail::basic_managed_memory_impl<CharType, MemoryAlgorithm, IndexType, Offset>::size_type) [with CharType = char; MemoryAlgorithm = boost::interprocess::rbtree_best_fit<boost::interprocess::null_mutex_family>; IndexType = boost::interprocess::null_index; long unsigned int Offset = 16; boost::interprocess::ipcdetail::basic_managed_memory_impl<CharType, MemoryAlgorithm, IndexType, Offset>::size_type = long unsigned int]’
/usr/include/boost/interprocess/detail/managed_memory_impl.hpp:744:40:   required from ‘bool boost::interprocess::ipcdetail::create_open_func<BasicManagedMemoryImpl>::operator()(void*, std::size_t, bool) const [with BasicManagedMemoryImpl = boost::interprocess::ipcdetail::basic_managed_memory_impl<char, boost::interprocess::rbtree_best_fit<boost::interprocess::null_mutex_family>, boost::interprocess::null_index, 16>; std::size_t = long unsigned int]’
/usr/include/boost/interprocess/detail/managed_open_or_create_impl.hpp:413:33:   required from ‘void boost::interprocess::ipcdetail::managed_open_or_create_impl<DeviceAbstraction, MemAlignment, FileBased, StoreDevice>::priv_open_or_create(boost::interprocess::ipcdetail::create_enum_t, const device_id_t&, std::size_t, boost::interprocess::mode_t, const void*, const boost::interprocess::permissions&, ConstructFunc) [with ConstructFunc = boost::interprocess::ipcdetail::create_open_func<boost::interprocess::ipcdetail::basic_managed_memory_impl<char, boost::interprocess::rbtree_best_fit<boost::interprocess::null_mutex_family>, boost::interprocess::null_index, 16> >; DeviceAbstraction = boost::interprocess::ipcdetail::file_wrapper; long unsigned int MemAlignment = 16; bool FileBased = true; bool StoreDevice = false; boost::interprocess::ipcdetail::managed_open_or_create_impl<DeviceAbstraction, MemAlignment, FileBased, StoreDevice>::device_id_t = const char*; std::size_t = long unsigned int]’
/usr/include/boost/interprocess/detail/managed_open_or_create_impl.hpp:185:10:   required from ‘boost::interprocess::ipcdetail::managed_open_or_create_impl<DeviceAbstraction, MemAlignment, FileBased, StoreDevice>::managed_open_or_create_impl(boost::interprocess::create_only_t, const device_id_t&, std::size_t, boost::interprocess::mode_t, const void*, const ConstructFunc&, const boost::interprocess::permissions&) [with ConstructFunc = boost::interprocess::ipcdetail::create_open_func<boost::interprocess::ipcdetail::basic_managed_memory_impl<char, boost::interprocess::rbtree_best_fit<boost::interprocess::null_mutex_family>, boost::interprocess::null_index, 16> >; DeviceAbstraction = boost::interprocess::ipcdetail::file_wrapper; long unsigned int MemAlignment = 16; bool FileBased = true; bool StoreDevice = false; boost::interprocess::ipcdetail::managed_open_or_create_impl<DeviceAbstraction, MemAlignment, FileBased, StoreDevice>::device_id_t = const char*; std::size_t = long unsigned int]’
/usr/include/boost/interprocess/managed_mapped_file.hpp:101:82:   required from ‘boost::interprocess::basic_managed_mapped_file<CharType, MemoryAlgorithm, IndexType>::basic_managed_mapped_file(boost::interprocess::create_only_t, const char*, boost::interprocess::basic_managed_mapped_file<CharType, MemoryAlgorithm, IndexType>::size_type, const void*, const boost::interprocess::permissions&) [with CharType = char; AllocationAlgorithm = boost::interprocess::rbtree_best_fit<boost::interprocess::null_mutex_family>; IndexType = boost::interprocess::null_index; boost::interprocess::basic_managed_mapped_file<CharType, MemoryAlgorithm, IndexType>::size_type = long unsigned int]’
prefixtrie.cpp:33:101:   required from here
/usr/include/boost/interprocess/segment_manager.hpp:433:7: error: static assertion failed: (boost::move_detail::alignment_of<header_t>::value >= void_ptr_alignment)
  433 |       BOOST_STATIC_ASSERT((boost::move_detail::alignment_of<header_t>::value >= void_ptr_alignment));
      |       ^~~~~~~~~~~~~~~~~~~
BrannonKing commented 2 years ago

If you run the build shell script that comes with it, does that fail?