Failed to build on Ubuntu Hirsute 21.04 #79

Closed
opened 2021-01-27 02:21:52 +00:00 by visvirial · 2 comments
visvirial commented 2021-01-27 02:21:52 +00:00 (Migrated from github.com)

I tried to build Monacoin on Ubuntu Hirsute 21.04 (PPA), but I got the following error.

g++ -std=c++11 -DHAVE_CONFIG_H -I. -I../src/config   -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I.  -DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC -pthread -I/usr/include -I./leveldb/include -I./leveldb/helpers/memenv   -I./secp256k1/include -I./univalue/include   -pthread -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS  -Wstack-protector -fstack-protector-all -Wall -Wextra -Wformat -Wvla -Wformat-security -Wno-unused-parameter -Wno-implicit-fallthrough    -fPIE -g -O2 -MT libbitcoin_server_a-httpserver.o -MD -MP -MF .deps/libbitcoin_server_a-httpserver.Tpo -c -o libbitcoin_server_a-httpserver.o `test -f 'httpserver.cpp' || echo './'`httpserver.cpp
In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                 from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23,
                 from /usr/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp:18,
                 from /usr/include/boost/smart_ptr/detail/spinlock.hpp:36,
                 from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:29,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/boost/signals2/signal.hpp:21,
                 from ./util.h:34,
                 from httpserver.cpp:9:
/usr/include/boost/function_output_iterator.hpp:14:1: note: ‘#pragma message: This header is deprecated. Use <boost/iterator/function_output_iterator.hpp> instead.’
   14 | BOOST_HEADER_DEPRECATED("<boost/iterator/function_output_iterator.hpp>")
      | ^~~~~~~~~~~~~~~~~~~~~~~
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

The complete build log can be found at here.

The error message says the std::deque is declared in <deque>, but this header file is not included in the source file.
It can be solved by just adding the "#include <deque>" directive.

This issue is also reported in the Litecoin repo https://github.com/litecoin-project/litecoin/issues/632 and was solved by the PR https://github.com/litecoin-project/litecoin/pull/643.

(In addition to this, the repo is not maintained for more than two years.
You should catch up to the upstream repo, or may cause a significant security defect.)

I tried to build Monacoin on Ubuntu Hirsute 21.04 (PPA), but I got the following error. ``` g++ -std=c++11 -DHAVE_CONFIG_H -I. -I../src/config -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I. -DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC -pthread -I/usr/include -I./leveldb/include -I./leveldb/helpers/memenv -I./secp256k1/include -I./univalue/include -pthread -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -Wstack-protector -fstack-protector-all -Wall -Wextra -Wformat -Wvla -Wformat-security -Wno-unused-parameter -Wno-implicit-fallthrough -fPIE -g -O2 -MT libbitcoin_server_a-httpserver.o -MD -MP -MF .deps/libbitcoin_server_a-httpserver.Tpo -c -o libbitcoin_server_a-httpserver.o `test -f 'httpserver.cpp' || echo './'`httpserver.cpp In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22, from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23, from /usr/include/boost/smart_ptr/detail/spinlock_std_atomic.hpp:18, from /usr/include/boost/smart_ptr/detail/spinlock.hpp:36, from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25, from /usr/include/boost/smart_ptr/shared_ptr.hpp:29, from /usr/include/boost/shared_ptr.hpp:17, from /usr/include/boost/signals2/signal.hpp:21, from ./util.h:34, from httpserver.cpp:9: /usr/include/boost/function_output_iterator.hpp:14:1: note: ‘#pragma message: This header is deprecated. Use <boost/iterator/function_output_iterator.hpp> instead.’ 14 | BOOST_HEADER_DEPRECATED("<boost/iterator/function_output_iterator.hpp>") | ^~~~~~~~~~~~~~~~~~~~~~~ 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 ``` The complete build log can be found at [here](https://launchpad.net/~visvirial/+archive/ubuntu/monacoin/+build/20939623). The error message says the std::deque is declared in &lt;deque&gt;, but this header file is not included in the source file. It can be solved by just adding the "#include &lt;deque&gt;" directive. This issue is also reported in the Litecoin repo https://github.com/litecoin-project/litecoin/issues/632 and was solved by the PR https://github.com/litecoin-project/litecoin/pull/643. (In addition to this, the repo is not maintained for more than two years. You should catch up to the upstream repo, or may cause a significant security defect.)
lae commented 2021-01-27 04:46:51 +00:00 (Migrated from github.com)

(In addition to this, the repo is not maintained for more than two years.
You should catch up to the upstream repo, or may cause a significant security defect.)

Just a quick note but this statement isn't entirely accurate. I don't know what the timeline for a release is like for this branch, though.
https://github.com/monacoinproject/monacoin/tree/base-0.18

> (In addition to this, the repo is not maintained for more than two years. > You should catch up to the upstream repo, or may cause a significant security defect.) Just a quick note but this statement isn't entirely accurate. I don't know what the timeline for a release is like for this branch, though. https://github.com/monacoinproject/monacoin/tree/base-0.18
wakiyamap commented 2021-01-28 03:59:27 +00:00 (Migrated from github.com)

Thanks for the report !!
I'll test it here as well.

Thanks for the report !! I'll test it here as well.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Core-Wallets/monacoin#79
No description provided.