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

How do I link a non ros library dependency in a catkin package?

asked 2014-04-09 09:15:46 -0600

Aaron Blasdel gravatar image

updated 2014-04-09 09:17:55 -0600

So I am trying to use the biotac_drivers package here:

I would like to link to "/lib/x86_64-linux-gnu/".

I know how to link a ROS package just fine but I'm coming up empty on how to link system dependencies.

On hydro, Ubuntu 3.11.10

Just incase I'm completely wrong on what I need to do here is the error:

Linking CXX executable /home/ablasdel/catkin_ws/devel/lib/biotac_sensors/biotac_pub

/usr/bin/ld: CMakeFiles/biotac_pub.dir/src/cheetah.c.o: undefined reference to symbol 'dlsym@@GLIBC_2.2.5'

/usr/bin/ld: note: 'dlsym@@GLIBC_2.2.5' is defined in DSO /lib/x86_64-linux-gnu/ so try adding it to the linker command line

/lib/x86_64-linux-gnu/ could not read symbols: Invalid operation

collect2: error: ld returned 1 exit status

make[2]: * [/home/ablasdel/catkin_ws/devel/lib/biotac_sensors/biotac_pub] Error 1

make[1]: * [biotac_driver/biotac_sensors/CMakeFiles/biotac_pub.dir/all] Error 2

make: * [all] Error 2

Invoking "make" failed

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-04-09 10:45:25 -0600

joq gravatar image

updated 2014-08-02 16:37:07 -0600

Glad that works for you.

For others with similar problems, a more complete answer can be found here:

edit flag offensive delete link more


That link broke with the package format 2 rollout here are the latest links: And for legacy format 1 if you are into that:

Aaron Blasdel gravatar image Aaron Blasdel  ( 2014-04-09 13:03:30 -0600 )edit

Thanks for noticing. I updated that link to the format2 version.

joq gravatar image joq  ( 2014-08-02 16:38:04 -0600 )edit

answered 2014-04-09 09:22:25 -0600

Aaron Blasdel gravatar image

Solved my own problem...

The issue was in the cmakelists.txt: target_link_libraries(biotac_pub ${catkin_LIBRARIES} -lm -ldl)

I added -ldl to the target link libraries and everything is AOK now.

edit flag offensive delete link more


Interesting that this solved my problem.But it should be enough to specify ${catkin_LIBRARIES}

lakehanne gravatar image lakehanne  ( 2017-02-04 21:09:15 -0600 )edit

Question Tools



Asked: 2014-04-09 09:15:46 -0600

Seen: 5,172 times

Last updated: Aug 02 '14