Groot icon indicating copy to clipboard operation
Groot copied to clipboard

compling error zmq when installing

Open lyd00116 opened this issue 2 years ago • 15 comments

I met an error when compling through catkin build: /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘void SidepanelMonitor::on_timer()’: /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp:44:41: error: no matching function for call to ‘zmq::socket_t::recv(zmq::message_t&)’ while( _zmq_subscriber.recv(msg) ) I also met: /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘bool SidepanelMonitor::getTreeFromServer()’: /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp:133:39: error: ‘zmq::send_flags’ has not been declared zmq_client.send(request, zmq::send_flags::none); ^~~~~~~~~~ /home/lyd/work/work0/groot_ws/src/Groot/bt_editor/sidepanel_monitor.cpp:135:60: error: ‘zmq::recv_flags’ has not been declared auto bytes_received = zmq_client.recv(reply, zmq::recv_flags::none); ^~~~~~~~~~ make[2]: *** [CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [CMakeFiles/behavior_tree_editor.dir/all] Error 2 make: *** [all] Error 2 I hope someone can help me!

lyd00116 avatar Nov 16 '22 12:11 lyd00116

@lyd00116 I recieved the same error. The problem may be in incompatibility of zmq and groot. Try to downgrade your zmq to 4.1 version and use behaviortree.cpp v3.8.

pverma907 avatar Nov 26 '22 15:11 pverma907

Thank you!

lyd00116 avatar Dec 01 '22 08:12 lyd00116

Good morning, I am facing the same exact error. using zmq 4.1 did not fix the issue. what can i do?

wisjaber avatar Mar 06 '23 08:03 wisjaber

I also encountered this problem, and downgraded the zmq version to 4.1, but still not solved!Is there any other solution?

/home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘void SidepanelMonitor::on_timer()’: /home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp:61:41: error: no matching function for call to ‘zmq::socket_t::recv(zmq::message_t&)’ while( zmq_subscriber.recv(msg) ) ^ In file included from /home/qw/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.h:5:0, from /home/qw/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:625:23: note: candidate: size_t zmq::socket_t::recv(void*, size_t, int) inline size_t recv (void *buf, size_t len_, int flags_ = 0) ^~~~ /usr/include/zmq.hpp:625:23: note: candidate expects 3 arguments, 1 provided /usr/include/zmq.hpp:635:21: note: candidate: bool zmq::socket_t::recv(zmq::message_t*, int) inline bool recv (message_t msg_, int flags_ = 0) ^~~~ /usr/include/zmq.hpp:635:21: note: no known conversion for argument 1 from ‘zmq::message_t’ to ‘zmq::message_t’ /home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘bool SidepanelMonitor::getTreeFromServer()’: /home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp:149:39: error: ‘zmq::send_flags’ has not been declared zmq_client.send(request, zmq::send_flags::none); ^~~~~~~~~~ /home/qwert/BehaviorTree.CPP/Groot/bt_editor/sidepanel_monitor.cpp:151:60: error: ‘zmq::recv_flags’ has not been declared auto bytes_received = zmq_client.recv(reply, zmq::recv_flags::none); ^~~~~~~~~~ CMakeFiles/behavior_tree_editor.dir/build.make:382: recipe for target 'CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o' failed make[2]: *** [CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o] Error 1 CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/behavior_tree_editor.dir/all' failed make[1]: *** [CMakeFiles/behavior_tree_editor.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

kundezui avatar Mar 06 '23 09:03 kundezui

@kundezui @wisesama see https://github.com/BehaviorTree/Groot/pull/172 https://github.com/BehaviorTree/Groot/pull/172/commits/a0db79aeb6bdf9deeeddea95c64e8c7b93526f02 I finally fix this problem with them.

lyd00116 avatar Mar 09 '23 11:03 lyd00116

https://github.com/BehaviorTree/Groot/issues/171

lyd00116 avatar Mar 09 '23 11:03 lyd00116

@lyd00116 can you maybe share what you did for it to work? because I certainly am still getting the same errors. And the issue you mentioned doesn't go over the same error? or am i missing something? for context I am using ROS1 with BTCPP v3.8

/home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘void SidepanelMonitor::on_timer()’: /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp:61:41: error: no matching function for call to ‘zmq::socket_t::recv(zmq::message_t&)’ while( zmq_subscriber.recv(msg) ) ^ In file included from /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.h:5:0, from /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:625:23: note: candidate: size_t zmq::socket_t::recv(void*, size_t, int) inline size_t recv (void *buf, size_t len_, int flags_ = 0) ^~~~ /usr/include/zmq.hpp:625:23: note: candidate expects 3 arguments, 1 provided /usr/include/zmq.hpp:635:21: note: candidate: bool zmq::socket_t::recv(zmq::message_t*, int) inline bool recv (message_t msg_, int flags_ = 0) ^~~~ /usr/include/zmq.hpp:635:21: note: no known conversion for argument 1 from ‘zmq::message_t’ to ‘zmq::message_t’ /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘bool SidepanelMonitor::getTreeFromServer()’: /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp:149:39: error: ‘zmq::send_flags’ has not been declared zmq_client.send(request, zmq::send_flags::none); ^~~~~~~~~~ /home/wissam/work/src/Groot/bt_editor/sidepanel_monitor.cpp:151:60: error: ‘zmq::recv_flags’ has not been declared auto bytes_received = zmq_client.recv(reply, zmq::recv_flags::none); ^~~~~~~~~~ CMakeFiles/behavior_tree_editor.dir/build.make:382: recipe for target 'CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o' failed make[2]: *** [CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o] Error 1 CMakeFiles/Makefile2:107: recipe for target 'CMakeFiles/behavior_tree_editor.dir/all' failed make[1]: *** [CMakeFiles/behavior_tree_editor.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2

wisjaber avatar Mar 09 '23 12:03 wisjaber

@wisesama Sorry,I can only recover some steps about solving this problem.You can try downloading the older edition instead the master of groot.And then may ecounter some problem with c++11....................(I don't remember the exact error).Then you can modify the code inside according #172 If it works,please tell me,thank you!

lyd00116 avatar Mar 09 '23 12:03 lyd00116

image

lyd00116 avatar Mar 09 '23 12:03 lyd00116

@kundezui @wisesama 参见#172 a0db79a 我终于和他们一起解决了这个问题。

The solution you pointed out doesn't seem to fit my error.

kundezui avatar Mar 10 '23 00:03 kundezui

try https://github.com/BehaviorTree/Groot/issues/181#issuecomment-1461925530

lyd00116 avatar Mar 10 '23 01:03 lyd00116

@lyd00116 Can't thank you enough, I used revert-157-Fix_Build branch and changed the CMakeList.txt file from the submit you mentioned and it worked! thanks again

wisjaber avatar Mar 10 '23 10:03 wisjaber

#172 fixed these issues but, downgrading to zmq 4.1 - https://github.com/zeromq/zeromq4-1.git gave me the following error using zmq 4.3.4 didn't throw these errors but for some reason, the TCP server never connects to GROOT for real-time monitoring

In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~~~~~~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~~~~~~~~~ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.h:22, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.cpp:1: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.h:22, from /home/ritik/ilrepo/src/Groot/bt_editor/graphic_container.cpp:3: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~~~~~~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~~~~~~~~~ /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~~~~~~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~~~~~~~~~ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.h:22, from /home/ritik/ilrepo/build/Groot/behavior_tree_editor_autogen/EFDBK3ICJA/moc_mainwindow.cpp:9, from /home/ritik/ilrepo/build/Groot/behavior_tree_editor_autogen/mocs_compilation.cpp:4: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~~~~~~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~~~~~~~~~ /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘void SidepanelMonitor::on_timer()’: /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:44:42: warning: ‘bool zmq::detail::socket_base::recv(zmq::message_t*, int)’ is deprecated: from 4.3.1, use recv taking a reference to message_t and recv_flags [-Wdeprecated-declarations] 44 | while( zmq_subscriber.recv(&msg) ) | ^ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:1407:10: note: declared here 1407 | bool recv(message_t *msg, int flags_ = 0) | ^~~~ /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp: In member function ‘bool SidepanelMonitor::getTreeFromServer()’: /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:133:32: warning: ‘bool zmq::detail::socket_base::send(zmq::message_t&, int)’ is deprecated: from 4.3.1, use send taking message_t and send_flags [-Wdeprecated-declarations] 133 | zmq_client.send(request); | ^ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:1326:10: note: declared here 1326 | bool send(message_t &msg_, | ^~~~ /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:135:47: warning: ‘bool zmq::detail::socket_base::recv(zmq::message_t*, int)’ is deprecated: from 4.3.1, use recv taking a reference to message_t and recv_flags [-Wdeprecated-declarations] 135 | bool received = zmq_client.recv(&reply); | ^ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.cpp:1: /usr/include/zmq.hpp:1407:10: note: declared here 1407 | bool recv(message_t *msg_, int flags_ = 0) | ^~~~ In file included from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_monitor.h:5, from /home/ritik/ilrepo/src/Groot/bt_editor/mainwindow.h:22, from /home/ritik/ilrepo/src/Groot/bt_editor/sidepanel_replay.cpp:17: /usr/include/zmq.hpp:638:14: error: ‘ZMQ_BLOCKY’ was not declared in this scope; did you mean ‘ZMQ_NOBLOCK’? 638 | blocky = ZMQ_BLOCKY, | ^~~~~~~~~~ | ZMQ_NOBLOCK /usr/include/zmq.hpp:642:31: error: ‘ZMQ_THREAD_AFFINITY_CPU_ADD’ was not declared in this scope 642 | thread_affinity_cpu_add = ZMQ_THREAD_AFFINITY_CPU_ADD, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:643:34: error: ‘ZMQ_THREAD_AFFINITY_CPU_REMOVE’ was not declared in this scope 643 | thread_affinity_cpu_remove = ZMQ_THREAD_AFFINITY_CPU_REMOVE, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:644:26: error: ‘ZMQ_THREAD_NAME_PREFIX’ was not declared in this scope 644 | thread_name_prefix = ZMQ_THREAD_NAME_PREFIX, | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/zmq.hpp:645:17: error: ‘ZMQ_MAX_MSGSZ’ was not declared in this scope; did you mean ‘ZMQ_MAXMSGSIZE’? 645 | max_msgsz = ZMQ_MAX_MSGSZ, | ^~~~~~~~~~~~~ | ZMQ_MAXMSGSIZE /usr/include/zmq.hpp:652:18: error: ‘ZMQ_MSG_T_SIZE’ was not declared in this scope 652 | msg_t_size = ZMQ_MSG_T_SIZE | ^~~~~~~~~~~~~~ make[2]: *** [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:95: Groot/CMakeFiles/behavior_tree_editor.dir/behavior_tree_editor_autogen/mocs_compilation.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: *** [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:264: Groot/CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_monitor.cpp.o] Error 1 make[2]: *** [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:225: Groot/CMakeFiles/behavior_tree_editor.dir/bt_editor/sidepanel_replay.cpp.o] Error 1 make[2]: *** [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:186: Groot/CMakeFiles/behavior_tree_editor.dir/bt_editor/graphic_container.cpp.o] Error 1 make[2]: *** [Groot/CMakeFiles/behavior_tree_editor.dir/build.make:134: Groot/CMakeFiles/behavior_tree_editor.dir/bt_editor/mainwindow.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:2778: Groot/CMakeFiles/behavior_tree_editor.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 Invoking "make -j12 -l12" failed

I am using ROS1, there's a similar issue #159 which is not fixing for ROS1

RitikJain12 avatar Mar 10 '23 17:03 RitikJain12

Do you know where I can find detailed information on learning BehaviorTree.CPP & Groot? Although there are tutorials on the official website, it is not suitable for beginners. Want to provide that kind of step-by-step detailed tutorial? @wisesama @RitikJain12 @pverma907 @lyd00116

kundezui avatar Mar 13 '23 03:03 kundezui

@lyd00116 Can't thank you enough, I used revert-157-Fix_Build branch and changed the CMakeList.txt file from the submit you mentioned and it worked! thanks again

Sorry,although I told you how to solve this problem,I forgot it almost in detail.So Could you tell me how to modify code to complie the revert-157-Fix_Build branch successfully? just modify those two lines? Also I do not know how to modify the Cmakelist.txt you mentioned.Thank you!

lyd00116 avatar Aug 30 '23 04:08 lyd00116