BehaviorTree / Groot

Graphical Editor to create BehaviorTrees. Compliant with BehaviorTree.CPP
730 stars 238 forks source link

Error when building on ROS2 foxy #159

Closed NickNair closed 1 year ago

NickNair commented 2 years ago

I tried building Groot in a ROS 2 workspace and I got the following error

[ 80%] Building CXX object CMakeFiles/Groot.dir/Groot_autogen/NYYW7IJ2JN/qrc_test_files.cpp.o
[ 81%] Linking CXX executable Groot
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `keypad@NCURSES6_TINFO_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `wgetch@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `wattr_off@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `wattr_on@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `endwin@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `initscr@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `mvwprintw@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `newwin@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `delwin@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `curs_set@NCURSES6_TINFO_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `wrefresh@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `noecho@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `werase@NCURSES6_5.0.19991023'
/usr/bin/ld: /opt/ros/foxy/lib/libbehaviortree_cpp_v3.so: undefined reference to `cbreak@NCURSES6_TINFO_5.0.19991023'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/Groot.dir/build.make:242: Groot] Error 1
make[1]: *** [CMakeFiles/Makefile2:130: CMakeFiles/Groot.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

These were the steps I followed before

cd dev_ws/src
git clone https://github.com/BehaviorTree/Groot.git
cd ..
rosdep install -i --from-path src --rosdistro foxy -y
colcon build
laurafbec commented 2 years ago

Hi @NickNair Were you able to install Groot on ROS2? I'm facing the next errors when trying to do it on ROS2 Galactic. Thanks in advanced

64%] Building CXX object CMakeFiles/behavior_tree_editor.dir/behavior_tree_editor_autogen/mocs_compilation.cpp.o In file included from /home/laura/Groot/bt_editor/sidepanel_monitor.h:5, from /home/laura/Groot/bt_editor/mainwindow.h:22, from /home/laura/Groot/build/behavior_tree_editor_autogen/EFDBK3ICJA/moc_mainwindow.cpp:9, from /home/laura/Groot/build/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 | ^~~~~~~~~~~~~~ make[2]: *** [CMakeFiles/behavior_tree_editor.dir/build.make:95: CMakeFiles/behavior_tree_editor.dir/behavior_tree_editor_autogen/mocs_compilation.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:158: CMakeFiles/behavior_tree_editor.dir/all] Error 2 make: *** [Makefile:141: all] Error 2

austin-InDro commented 2 years ago

Same issues here with Humble

austin-InDro commented 2 years ago

Figured out the issue. It's a problem with linking. You need to modify the CMakeLists.txt from SET(GROOT_DEPENDENCIES QtNodeEditor ) to SET(GROOT_DEPENDENCIES QtNodeEditor curses ncursesw tinfo )

laurafbec commented 2 years ago

Thanks @austin-InDro! In my case it was a conflict with a previos version of the libzmq lib.