ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

libbondcpp.so: undefined reference to core ROS functions & packages error

asked 2020-02-06 08:24:46 -0500

Ozan Mert Duran gravatar image

updated 2020-02-06 12:17:47 -0500

Hello, while compiling my catkin_ws I am encountering this issue while trying to build zed_wrapper_node. Libbondcpp from what I understand is a core ROS pre-compiled library which should always be recognized, along with the NodeHandle and SteadyTimer instances, indicating there is something wrong with my ROS setup. However, all of my other packages are compiling just fine, and they definitely also reference these same files, so I'm stumped. I'm running Kinetic, Ubuntu 16.04, Cuda 10.0, ZED SDK 3.0.1, and an NVIDIA GTX750ti with driver version 430.64. gcc version 6.5.0

The build log:

    [ 91%] Built target amcl
    [ 92%] Built target robot_pose_ekf
    [ 92%] Built target test_robot_pose_ekf
    [ 92%] Built target ros_filter_utilities
    [ 92%] Built target ublox_gps
    [ 92%] Built target geoconv
    [ 92%] Built target filter_utilities
    [ 92%] Built target collada_to_urdf

[ 92%] Built target urg_c_wrapper
[ 92%] Built target kdl_parser
[ 93%] Linking CXX executable /home/monarch/catkin_ws/devel/lib/zed_wrapper/zed_wrapper_node
[ 95%] Built target record
[ 95%] Built target collada_parser_plugin
[ 95%] Built target collada_urdf
[ 95%] Built target play
[ 95%] Built target navsat_transform
[ 95%] Built target filter_base
[ 95%] Built target costmap_2d
[ 96%] Built target ublox_gps_node
[ 96%] Built target check_kdl_parser
[ 96%] Built target getID
[ 97%] Built target urg_node
[ 97%] Built target ekf
[ 97%] Built target ukf
[ 97%] Built target navsat_transform_node
[ 97%] Built target urdf_to_collada
[ 98%] Built target costmap_2d_cloud
[ 98%] Built target costmap_2d_markers
[ 98%] Built target layers
[ 98%] Built target costmap_2d_node
[ 98%] Built target localization
[ 98%] Built target ros_filter
[ 98%] Built target clear_costmap_recovery
[ 98%] Built target point_grid
[ 98%] Built target move_slow_and_clear
[ 98%] Built target navfn
[ 98%] Built target ekf_localization_node
[ 98%] Built target move_base
[ 98%] Built target ukf_localization_node
[100%] Built target base_local_planner
[100%] Built target navtest
[100%] Built target move_base_node
/opt/ros/kinetic/lib/libbondcpp.so: undefined reference to `ros::NodeHandle::createSteadyTimer(ros::WallDuration, boost::function<void (ros::SteadyTimerEvent const&)> const&, bool, bool) const'
/opt/ros/kinetic/lib/libbondcpp.so: undefined reference to `ros::SteadyTimer::setPeriod(ros::WallDuration const&, bool)'
/opt/ros/kinetic/lib/libbondcpp.so: undefined reference to `ros::SteadyTimer::~SteadyTimer()'
/opt/ros/kinetic/lib/libbondcpp.so: undefined reference to `ros::SteadyTimer::stop()'
collect2: error: ld returned 1 exit status
[100%] Built target navfn_node
zed-ros-wrapper/zed_wrapper/CMakeFiles/zed_wrapper_node.dir/build.make:152: recipe for target '/home/monarch/catkin_ws/devel/lib/zed_wrapper/zed_wrapper_node' failed
make[2]: *** [/home/monarch/catkin_ws/devel/lib/zed_wrapper/zed_wrapper_node] Error 1
CMakeFiles/Makefile2:62021: recipe for target 'zed-ros-wrapper/zed_wrapper/CMakeFiles/zed_wrapper_node.dir/all' failed
make[1]: *** [zed-ros-wrapper/zed_wrapper/CMakeFiles/zed_wrapper_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Built target global_planner
[100%] Built target trajectory_planner_ros
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed

My Cmakelists for zed_ros_wrapper:

cmake_minimum_required(VERSION 2.8.7)

project(zed_wrapper)

# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
IF(NOT CMAKE_BUILD_TYPE)
    SET(CMAKE_BUILD_TYPE Release)
ENDIF(NOT CMAKE_BUILD_TYPE)

function(checkPackage package customMessage)
    set(varName "${package}_FOUND")
    if (NOT "${${varName}}")
        string(REPLACE "_" "-" aptPackage ${package})
        if("${customMessage}" STREQUAL "")
            message(FATAL_ERROR "\n\n ${package} is missing, please try to install it with:\n sudo apt-get install ros- ...
(more)
edit retag flag offensive close merge delete

Comments

1

Sorry I should have commented on the question and not the answer.

And correct, I did install ROS from packages using apt(desktop full if I remember correctly), and all my packages are up to date and neither update nor upgrade changes anything at the moment.

OK so there is no reason for this to not work as you have the last version of everything.

It is a bit hard to debug your issue as there are many moving parts (CUDA, proprietary SDK, many packages unrelated to ZED in you workspace lie move_base).


Could you confirm that you have the same error building a simple workspace with a nodelet. like

mkdir -p /tmp/test_ws/src && cd /tmp/test_ws/
git clone https://github.com/ros-gbp/common_tutorials-release.git -b release/kinetic/nodelet_tutorial_math/0.1.10-0 /tmp/test_ws/src/common_tutorials/nodelet_tutorial_math
VERBOSE=1 catkin_make

The goal is to figure out if you ...(more)

marguedas gravatar image marguedas  ( 2020-02-06 11:14:51 -0500 )edit

I do not have the same error, it builds without issue. Sorry for not responding sooner, didn't see this comment.

idge -Wl,-rpath,/opt/ros/kinetic/lib: 
make[2]: Leaving directory '/tmp/test_ws/build'
[100%] Built target nodelet_math
make[1]: Leaving directory '/tmp/test_ws/build'
/usr/bin/cmake -E cmake_progress_start /tmp/test_ws/build/CMakeFiles 0
Ozan Mert Duran gravatar image Ozan Mert Duran  ( 2020-02-06 12:00:49 -0500 )edit
1

Ok good news. Now can you try the same with a workspace with ONLY the zed-ros-wrapper in it ? and edit you original question with the full build output?

marguedas gravatar image marguedas  ( 2020-02-06 12:08:20 -0500 )edit

I created catkin_new, made src, cloned the git, and IT COMPILED adding the full build output.

Ozan Mert Duran gravatar image Ozan Mert Duran  ( 2020-02-06 12:15:59 -0500 )edit

OK, so I took the new workspace, and started adding necessary folders from my previous workspace until it broke. The issue is that it isn't breaking consistently, which is preventing me from troubleshooting effectively.

Ozan Mert Duran gravatar image Ozan Mert Duran  ( 2020-02-06 13:31:50 -0500 )edit
1

does it also break if you build your workspace in isolation ? (using catkin_make_isolated)

A workaround is to keep the working version of the zed wrapper in a workspace and build all your stuff in another workspace this way you don't mix or rebuild the one that works

marguedas gravatar image marguedas  ( 2020-02-06 17:21:45 -0500 )edit

Yes it does also break if I build it that way. I am now attempting to build just the zed_wrapper in one folder as I did before and the rest in another, and the zed_wrapper is failing in the same manner as before:

libbondcpp.so: undefined reference to x

So I went to confirm that in our building the nodelet on its own beforehand wasn't causing some strange magic to occur, so I refollowed all the steps (cleaned up that tmp_ws, remade and compiled it), then made another new catkin_ws, and followed the steps for the zed_wrapper but it still isn't compiling.

Ozan Mert Duran gravatar image Ozan Mert Duran  ( 2020-02-06 17:51:13 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-02-06 21:24:11 -0500

Ozan Mert Duran gravatar image

The problem was/is caused by this line while compiling:

 Using CMAKE_PREFIX_PATH: /home/monarch/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/monarch/catkin_ws/devel;/opt/ros/kinetic

I was comparing what my failed buildlog looked like with the one that succeeded, and the variances are the above, plus using a different c compiler and cxx compiler. The solution was to ensure that the workspaces are not overlaid, which I did by clearing out the catkin_zed workspace, using wstool init src after creating that folder, getting the zed wrapper in src, running wstool update while in src, going to the parent directory of catkin_zed then catkin_make. I am not certain how to prevent it from defaulting to selecting the overlaid workspace, but this is something to keep in mind.

edit flag offensive delete link more
0

answered 2020-02-06 08:46:57 -0500

eirikaso gravatar image

I think you need to link your libbondcpp library under "target_link_libraries" like this:

target_link_libraries(zed_wrapper_node ZEDWrapper bondcpp ${LINK_LIBRARIES})

or something similar

edit flag offensive delete link more

Comments

Thanks, giving it a try. Received an error by inputting in zed_wrapper_node, so I removed that. It couldn't find bondcpp, so I renamed it bond but basically came up with the same error. Here's what it's looking like now:

/usr/bin/ld: cannot find -lbond collect2: error: ld returned 1 exit status zed-ros-wrapper/zed_wrapper/CMakeFiles/ZEDWrapper.dir/build.make:177: recipe for target '/home/monarch/catkin_ws/devel/lib/libZEDWrapper.so' failed make[2]: * [/home/monarch/catkin_ws/devel/lib/libZEDWrapper.so] Error 1 CMakeFiles/Makefile2:61407: recipe for target 'zed-ros-wrapper/zed_wrapper/CMakeFiles/ZEDWrapper.dir/all' failed make[1]: [zed-ros-wrapper/zed_wrapper/CMakeFiles/ZEDWrapper.dir/all] Error 2 make[1]: ** Waiting for unfinished jobs.... [ 91%] Built target kdl_parser [ 91%] Built target urg_c_wrapper [ 91%] Built target relay [ 91%] Built target collada_parser_plugin [ 91%] Built target mux [ 91%] Built target collada_urdf [ 92%] Built target drop

Ozan Mert Duran gravatar image Ozan Mert Duran  ( 2020-02-06 08:51:25 -0500 )edit

To clarify, I've added

add_library(ZEDWrapper ${TOOLS_SRC} ${NODELET_SRC})
add_library(bondcpp ${TOOLS_SRC} ${NODELET_SRC}) //Just recently tried adding this after reading the target_link_libraries page on catkin
target_link_libraries(ZEDWrapper bondcpp ${LINK_LIBRARIES}) //I've also tried bond and libbond and libbondcpp

I am still receiving errors.

Ozan Mert Duran gravatar image Ozan Mert Duran  ( 2020-02-06 09:15:45 -0500 )edit

what if you put in find_package(bondcpp) together with your other find_packages?

eirikaso gravatar image eirikaso  ( 2020-02-06 09:16:33 -0500 )edit

Like this:

    SET(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
endif()

find_package(bondcpp)

find_package(CUDA)
checkPackage("CUDA" "CUDA not found, install it from:\n https://developer.nvidia.com/cuda-downloads")

I've also tried adding bondcpp into the catkin COMPONENTS part. I reverted to just adding the above and the below target_link_libraries(ZEDWrapper bondcpp ${LINK_LIBRARIES}) Just to clarify. I'm still receiving the same error

/usr/bin/ld: cannot find -lbondcpp
Ozan Mert Duran gravatar image Ozan Mert Duran  ( 2020-02-06 09:23:41 -0500 )edit

What version of roscpp are you using ? and what version of bondcpp?

My guess is that you're using an old roscpp with a recent bondcpp


Does any code in "zed-ros-wrapper" actually uses bondcpp ?

marguedas gravatar image marguedas  ( 2020-02-06 09:38:48 -0500 )edit

How do I go about checking my roscpp and bondcpp version? I would imagine it does use bondcpp as it likely monitors if there is a subscriber is listening, but I don't know.

Ozan Mert Duran gravatar image Ozan Mert Duran  ( 2020-02-06 09:46:30 -0500 )edit
1

It should show up in your CMake output. "Found roscpp: ..."

If you installed with apt you can also use apt list - apt list ros-kinetic-roscpp - apt list ros-kinetic-bondcpp


Just to confirm your setup: - You installed ROS from packages (using apt) - All your packages up to date: sudo apt update && apt list --upgradable | grep ros-kinetic doesn;t print anything

Is that correct ?

marguedas gravatar image marguedas  ( 2020-02-06 09:59:57 -0500 )edit

ros-kinetic-roscpp/xenial,now 1.12.14 ros-kinetic-bondcpp/xenial,now 1.8.3-0xenial

And correct, I did install ROS from packages using apt(desktop full if I remember correctly), and all my packages are up to date and neither update nor upgrade changes anything at the moment. Also, please treat me like I don't know anything where convenient.

Ozan Mert Duran gravatar image Ozan Mert Duran  ( 2020-02-06 10:05:05 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-02-06 08:24:46 -0500

Seen: 576 times

Last updated: Feb 06 '20