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

Undefined reference error while building

asked 2022-03-31 15:00:46 -0600

zippyzoo77 gravatar image

I am trying to update my version of rtabmap to the current one on Ubuntu 20.04 with ros noetic. While following the instructions below from here:

############ rtabmap ###########
$ cd rtabmap
$ git pull origin master
$ cd build
$ make #<-- This is where I get the error
$ make install # Do "sudo make install" if you installed rtabmap in "/usr/local"

############ rtabmap_ros###########
$ roscd rtabmap_ros
$ git pull origin master
$ roscd
$ cd ..
$ catkin_make -j1 --pkg rtabmap_ros

At the indicated point, I end up with the following error:

(base) zippyzoo77@MountainLion:~/rtabmap/build$ make
[ 4%] Built target rtabmap_utilite
[ 5%] Built target res_tool
[ 42%] Built target rtabmap_core
[ 80%] Built target rtabmap_gui
[ 81%] Linking CXX executable ../../bin/rtabmap
/usr/bin/ld: ../../bin/librtabmap_core.so.0.20.19: undefined reference to `octomath::Pose6D::Pose6D(octomath::Pose6D const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [app/src/CMakeFiles/rtabmap.dir/build.make:243: bin/rtabmap] Error 1
make[1]: *** [CMakeFiles/Makefile2:993: app/src/CMakeFiles/rtabmap.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

I have done all the proper steps and have octomap installed, so I really don't know what could be causing this error. Any help on debugging this so I can get rtabmap up and working would be greatly appreciated. Thanks!

I also get this warning (for over a dozen libraries in the same location) during a previous install step, which I think may be at the root of the problem. What could cause my installation of ROS to be doing this to my files, and how can I fix this?

CMake Warning at examples/NoEventsExample/CMakeLists.txt:64 (ADD_EXECUTABLE):
  Cannot generate a safe runtime search path for target noEventsExample
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [liboctomap.so.1.9] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /opt/ros/noetic/lib
    runtime library [liboctomath.so.1.9] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /opt/ros/noetic/lib

  Some of these libraries may not be found correctly.
edit retag flag offensive close merge delete

Comments

hey, if your create the workspace it is catkin_make or not?

Petros ADLATUS gravatar image Petros ADLATUS  ( 2022-03-31 23:48:15 -0600 )edit
1

Eventually it is catkin_make yes, but that's not where I was running into trouble. I still don't know what was causing this, I eventually ended up just completely uninstalling rtabmap and reinstalling it.

zippyzoo77 gravatar image zippyzoo77  ( 2022-04-05 16:34:34 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2022-08-11 02:45:21 -0600

moooeeeep gravatar image

I just had the same error. It seemed I forgot to source my ros installation (where the octomap was installed) before the build.

After I sourced /opt/ros/noetic/setup.bash it built just fine.

edit flag offensive delete link more

Comments

where did you source it to by the way?

efe gravatar image efe  ( 2023-01-24 14:10:47 -0600 )edit

To the shell where I run the build command.

moooeeeep gravatar image moooeeeep  ( 2023-01-26 02:13:24 -0600 )edit

More info from this post:

On Noetic, another cause is that both liboctomap-dev and ros-noetic-octomap may be installed at the same time (some ros packages depend on the system version, and others on the noetic version). Cleanup rtabmap's build directory, make sure you sourced /opt/ros/noetic/setup.bash and redo cmake/make. Rtabmap's cmake should find the version in /opt/ros/noetic first, thus it will work with ros-noetic-octomap-msgs used by rtabmap_ros, and the undefined reference error won't show up.

matlabbe gravatar image matlabbe  ( 2023-01-27 16:44:33 -0600 )edit
1

answered 2022-04-05 16:35:14 -0600

zippyzoo77 gravatar image

I never did figure out why it was doing this, but I uninstalled and reinstalled rtabmap and now it is working.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-03-31 15:00:46 -0600

Seen: 625 times

Last updated: Aug 11 '22