Ask Your Question
1

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

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

Aaron Blasdel gravatar image

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

So I am trying to use the biotac_drivers package here: https://github.com/kth-ros-pkg/biotac...

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

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/libdl.so.2 so try adding it to the linker command line

/lib/x86_64-linux-gnu/libdl.so.2: 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
3

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

joq gravatar image

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

Glad that works for you.

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

edit flag offensive delete link more

Comments

That link broke with the package format 2 rollout here are the latest links: http://docs.ros.org/api/catkin/html/howto/format2/system_library_dependencies.html And for legacy format 1 if you are into that: http://docs.ros.org/api/catkin/html/howto/format1/system_library_dependencies.html

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

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

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

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

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

Comments

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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 4,265 times

Last updated: Aug 02 '14